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

[WORKAROUND] br are still included in widgets that are children of the <<do>> macro when Config.passages.nobr = true #331

Closed wjkmartin closed 2 months ago

wjkmartin commented 2 months ago

Describe the bug. \
are still included in widgets that are children of the \<\> macro when Config.passages.nobr = true

To Reproduce: Steps to reproduce the behavior:

  1. Config.passages.nobr = true
  2. Create a \<\> macro with a direct child of a widget that has new lines

e.g.

:: StoryInit
<<run Config.passages.nobr = true >>

:: Start
<<do>>
<<WidgetName>>
<</do>>

:: WidgetPassage [widget]
<<widget "WidgetName">>
intentional spaces below

<</widget>>

Expected behavior. No \
to appear in the document

Screenshots. (Not from the given example)

image

Project details.

Desktop details.

Additional context. Workaround exists: add the "nobr" tag to the widget passage and it works as expected

manonamora commented 2 months ago
Config.passages.nobr = true;

Should be placed in your JavaScript not in your StoryInit passage.

(I get not bug when in JavaScript, only when the code is in StoryInit, Config APIs should not be there)

wjkmartin commented 2 months ago
Config.passages.nobr = true;

Should be placed in your JavaScript not in your StoryInit passage.

(I get not bug when in JavaScript, only when the code is in StoryInit, Config APIs should not be there)

Confirmed that was the issue!