Open gulumige opened 2 years ago
Config.cleanupWikifierOutput
is a temperamental beast.
Due to various reasons it is only called for top-level parser (Wikifier
) calls—meaning those without a Wikifier
ancestor. That's what's biting you in most (all?) of the cases you encountered.
It also doesn't handle out-of-band content injection terribly well.
Anyway. There are, unfortunately, no good or simple fixes for its issues with the current recursive/chunky parser.
I had
Config.cleanupWikifierOutput
set totrue
on one of my projects and I noticed that whenever I usedEngine.show()
it wouldn't convert the<br>
elements to<p>
elements. It also didn't seem to have any effect on the body of theDialog
except for adding a lot of extra<p>
elements to theSettings
menu which was a bit annoying. It did seem to work as expected when callingSugarCube.Engine.show()
from the console in any browser I tried. (same withSugarCube.Dialog...
).I decided to take a deeper look and, while it's a bit over my head, from what I gathered is that if any
Engine
navigation methods or theDialog.wiki()
method is executed from "wikifying" the content inside of a macro like<<link>>
or<<button>>
it will not "clean up" the incoming text. I did also discover theconvertBreaks
function and figured it could be as both a bandaid fix and to demonstrate the issue.Additional context. Not sure if this is really a bug or more of a side effect but I figured I'd report it.