View Single Post
Old 03-31-2017, 09:26 AM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,894
Karma: 6120478
Join Date: Nov 2009
Device: many
Hi All,
Sorry to be late to this discussion but Doitsu just pointed it out to me ... ;-)

I am not sure I understand exactly what is being asked for here. Would you please provide one xhtml code snippet from the area around the body tag that shows exactly why or how you need to NOT use an id that defaults to the top of the file? That will help me better to understand what is going on that the current TOC algorithm is not doing well with.

Right now, the code in Sigil sets any *first* heading in a file after after the body tag that is within 20 source lines from the line with the body tag to point to the top of the file (in other words, no need for an fragment).

Normally this is a good thing and is what most people want since it makes for fewer fragments and less code in general.

If there is a good argument / logic why this creates an issue with NCX or Nav generation, I would be happy to consider making the 20 source line difference a user controllable setting (or disabling this check completely).

But I would have to understand the use case or problem (and I am not sure I do now) and would have to see that a simple search and replace to insert a hidden "dummy" header, right after the body tag wouldn't work just as well. After generating the NCX/TOC/NAV, a second Search & Replace can remove the hidden header tags easily to prevent code bloat.

In general, I really hate adding new settings that would just confuse most novice users when a simple workaround by experienced users would prevent the entire issue. But if it is needed to prevent bugs in TOC/NCX/Nav creation under some circumstances, then a setting is probably needed.

Thanks

Last edited by KevinH; 03-31-2017 at 09:41 AM.
KevinH is offline   Reply With Quote