You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per this discussion, even though Lua exposes the make_sections function for use in filters, most of the pandoc writers (including HTML) call makeSection themselves, even if it has already been called. If your filter creates its own div/section/similar containing element aftermakeSection is called the first time, the second call to makeSection recreates the original div/section, breaking the result of the filter.
It would be good if the writers were only to call makeSection if it hasn't already been run, or equivalently, if makeSection could determine whether it had already been run, and only manipulate the AST if it has yet to be run.
This strikes me as the least disruptive change to enable filters to manipulate the divs/sections created around headers. Another approach could be to add an attribute to a header that prevents a div/section from being constructed around it by makeSections, but that seems like more difficult and more clumsy.
The text was updated successfully, but these errors were encountered:
Actually, I'm not yet convinced there is a problem. makeSections is already written in such a way that it shouldn't matter if it's run twice. See the test cases for the idempotency of makeSections which I just added to confirm this...
It may be that you made alterations that defeated this, but in that case we need more information.
Okay, I revisited the Lua filter I had written that makeSections makes difficult, and I don't seem to be getting the behavior that put me off it last year. Perhaps a subsequent update has fixed this issue silently? I'll play around a little more, and if I stumble upon this problem again, I'll reopen this, but I think for now I will close it. Sorry for the runaround!
Per this discussion, even though Lua exposes the
make_sections
function for use in filters, most of the pandoc writers (including HTML) callmakeSection
themselves, even if it has already been called. If your filter creates its own div/section/similar containing element aftermakeSection
is called the first time, the second call tomakeSection
recreates the original div/section, breaking the result of the filter.It would be good if the writers were only to call
makeSection
if it hasn't already been run, or equivalently, ifmakeSection
could determine whether it had already been run, and only manipulate the AST if it has yet to be run.This strikes me as the least disruptive change to enable filters to manipulate the divs/sections created around headers. Another approach could be to add an attribute to a header that prevents a div/section from being constructed around it by
makeSections
, but that seems like more difficult and more clumsy.The text was updated successfully, but these errors were encountered: