Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Engine.backward() disables Config.cleanupWikifierOutput = true #240

Open
david-donachie opened this issue Jun 10, 2023 · 6 comments
Open
Labels
bug Something isn't working

Comments

@david-donachie
Copy link

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:

  1. Set Config.cleanupWikifierOutput = true in story JS
  2. View a passage
  3. Go to a second passage
  4. 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
@david-donachie david-donachie added the bug Something isn't working label Jun 10, 2023
@david-donachie
Copy link
Author

Related #189

@tmedwards
Copy link
Owner

This is likely related to timing. I.e., Going backwards before the last moment has finished rendering.

@hituro
Copy link

hituro commented Jul 6, 2023

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?

@tmedwards
Copy link
Owner

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.

@hituro
Copy link

hituro commented Jul 6, 2023

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?

@greyelf
Copy link

greyelf commented Jul 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants