
Just in case someone else wonders, one workaround is to also set the `list`
argument (I guess there must be a way to do it automatically, but I've not
found one so far):
_________________________________________
\setupbackend[export=yes]
\setupinteraction[state=start]
\definereferenceformat[Content][left=,right=,type=title]
\starttext
\placecontent
\startchapter[title=Chapter 1]
Blahblah
\stopchapter
\startchapter[title=Chapter 2, reference=chapter_2,
list=\Content[chapter_2]]
Blahblahblah
\stopchapter
\stoptext
___________________________________________
Cheers,
Florent
Le mer. 12 févr. 2025 à 21:39, Florent Michel
Hi,
It seems (unless I am missing something) that hyperlinks in the table of contents for the exported html are incorrect when `reference` is set.
Minimal(-ish) working example: _________________________________ \setupbackend[export=yes] \setupinteraction[state=start]
\starttext
\placecontent
\startchapter[title=Chapter 1] Blahblah \stopchapter
\startchapter[title=Chapter 2, reference=chapter_2] Blahblahblah \stopchapter \stoptext _________________________________
Annotated relevant part of the generated `.html`:
... <div> <div class="list"> <div class="listitem chapter" href="#aut-1" onclick="location.href='#aut-1'"> <!-- THis is correct --> <div class="listtag">1</div> <div class="listcontent">Chapter 1</div> <div class="listpage">2</div> </div> <div class="listitem chapter" href="#aut-2" onclick="location.href='#aut-2'"> <!-- I think "#aut-2" should read "#chapter_2" --> <div class="listtag">2</div> <div class="listcontent">Chapter 2</div> <div class="listpage">3</div> </div> </div> <div class="section chapter level-2" id="aut-1"> <div class="sectioncaption"> <div class="sectionnumber">1</div> <div class="sectiontitle">Chapter 1</div> </div> <div class="sectioncontent"> Blahblah </div> </div> <div class="section chapter level-2" id="chapter_2"> <div class="sectioncaption"> <div class="sectionnumber">2</div> <div class="sectiontitle">Chapter 2</div> </div> <div class="sectioncontent"> Blahblahblah </div> </div> </div> ...
Would someone be aware of a workaround (apart from using ‘aut-2’ as reference in this case) or other solution?
Best regards, Florent