sugarcube-2
sugarcube-2 copied to clipboard
Engine.backward() disables Config.cleanupWikifierOutput = true
Describe the bug.
Using Engine.backward()
in a story with Config.cleanupWikifierOutput = true
generates a passage with <br>
tags as if Config.cleanupWikifierOutput
was not set.
To Reproduce:
- Set Config.cleanupWikifierOutput = true in story JS
- View a passage
- Go to a second passage
- Run Engine.backward() to go back to the first pasage
Expected behavior.
The first passage should have <p>
tags as normal, but just has plain <br>
instead
Project details.
- SugarCube Version: 2.36.1
- Compiler & Version: Twine 2.6.1
Desktop details.
- OS & Version: OSX
- Browser & Version Firefox
Related #189
This is likely related to timing. I.e., Going backwards before the last moment has finished rendering.
This is likely related to timing. I.e., Going backwards before the last moment has finished rendering.
It seemed to happen even if I waited a long while. Could it be that the engine renders the past moment differently and doesn't load the config setting?
Config
settings, in general, should be set in either the story JavaScript or StoryInit
, which is to say not only outside of the story history but before it even begins. In that case, the setting should always be active during normal operation.
All moments are rendered equally, wrt. the setting anyway.
The cleanup setting is only used if no other Wikifier calls are active somewhere. This is the likely culprit of "it no worky at all" the majority of the time.
Yes, I didn't mean that the Config setting was being reset, I was implying that the rendering process involved in Engine.backward()
didn't honour it.
So, given that this happens even if there is a long delay before going backwards, it implies that the process nevertheless invokes another Wikifier? Could it be related to StoryInterface rendering passages?
I tested the reported behaviour using links like...
<<link 'Backward'>><<run Engine.backward()>><</link>>
...and...
<<link 'Forward'>><<run Engine.forward()>><</link>>
...and the issue also occurs when Engine.forward()
is used to wind History forward again.
The Undo and Redo navigation links did not display the reported behaviour when used in the same testing project.