The issue was discovered (not by me) in a simple text where part of it was added later using the <<timed>> macro. Boiling it down to the smallest possible code, the following code creates markedly different results depending on the Config.cleanupWikifierOutput setting:
... but even if it was, there is currently no option to not surround the result with a <p>...</p> block that would be passed on to the internal convertBreaks() method. The issue is compounded by the fact that a construct like this:
A starting paragraph <<timed 1s>>that is being extended...
And also split apart<</timed>>. Isn't it //fun//?!?
... would require the macro to split the surrounding <p> DOM element into two ore more.
No generically applicable workaround aside of not using the setting exist yet, to my knowledge. For the use case of "inline" <<timed>>only, the following as a replacement of the above line of the <<timed>> macro works well enough:
let oldCleanup = Config.cleanupWikifierOutput;
Config.cleanupWikifierOutput = false;
new Wikifier(frag, item.content);
Config.cleanupWikifierOutput = oldCleanup;
The issue was discovered (not by me) in a simple text where part of it was added later using the
<<timed>>
macro. Boiling it down to the smallest possible code, the following code creates markedly different results depending on theConfig.cleanupWikifierOutput
setting:Result with
Config.cleanupWikifierOutput = false
Result with
Config.cleanupWikifierOutput = true
Inside of the
<<timed>>
macro specifically, the Wikifier gets called without any options:Ref: https://github.com/tmedwards/sugarcube-2/blob/master/src/macros/macrolib.js#L3426
... but even if it was, there is currently no option to not surround the result with a
<p>...</p>
block that would be passed on to the internalconvertBreaks()
method. The issue is compounded by the fact that a construct like this:... would require the macro to split the surrounding
<p>
DOM element into two ore more.No generically applicable workaround aside of not using the setting exist yet, to my knowledge. For the use case of "inline"
<<timed>>
only, the following as a replacement of the above line of the<<timed>>
macro works well enough: