tmedwards / sugarcube-2

SugarCube is a free (gratis and libre) story format for Twine/Twee.
https://www.motoslave.net/sugarcube/2/
BSD 2-Clause "Simplified" License
185 stars 42 forks source link

<<cycle>> + cleanupWikifierOutput() encloses content in a <p> #231

Closed hituro closed 1 year ago

hituro commented 1 year ago

Describe the bug. When Config.cleanupWikifierOutput = true, the contents of a <<cycle>> macro are wrapped in a <p> tag after the first click.

To Reproduce: The following code, in a file with Config.cleanupWikifierOutput = true

<<nobr>><<cycle "_blah">>
    <<option "Towel">>
    <<option "π" 3.14159>>
    <<option 42>>
    <<option 69>>
    <<option "∞" Infinity>>
<</cycle>><</nobr>>

Shows the issue

Expected behavior. There shouldn't be a <p> tag, since Config.cleanupWikifierOutput = true isn't supposed to apply to sub-wikis

Screenshots. Generated HTML on page load

<p><a id="cycle--blah" class="macro-cycle" role="button" tabindex="0">Towel</a></p>

HTML after first click

<a id="cycle--blah" class="macro-cycle" role="button" tabindex="0"><p>π</p></a>

Project details.

tmedwards commented 1 year ago

Duplicate #154.