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

Dynamic Tags are generated in reverse order #1047

Closed
isyourguy opened this issue Mar 20, 2024 · 2 comments · Fixed by #1060
Closed

Dynamic Tags are generated in reverse order #1047

isyourguy opened this issue Mar 20, 2024 · 2 comments · Fixed by #1060

Comments

@isyourguy
Copy link

Describe the bug

Using Dynamic Tags inside Choices causes the Tag string to be generated in reverse order. (i.e. #tag {var1}{var2} becomes var2var1tag )

To Reproduce

Create a Dynamic Tag inside of a choice. (i.e. +[choice #tag {var1}{var2}]

Expected behavior

The Tag string should be generated in the correct order.

Environment

  • OS: Windows
  • Web browser version: Firefox 123
  • inkjs version: 2.2.2

Additional context

In Ink, Dynamic Tags are generated by iterating over a stack, namely contentStackForTag in Story.cs. Because the output stream is iterated over in reverse order this makes sense, as the first element pushed to the stack is the last element removed. This same variable in inkjs is an array, and thus when iterated over, the last element pushed to the array is also the last that is appended to the string.

@smwhr
Copy link
Collaborator

smwhr commented Mar 21, 2024

Thanks for the report !

@smwhr
Copy link
Collaborator

smwhr commented May 14, 2024

Fixed in next release 2.2.3

@smwhr smwhr closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants