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

Invalid result when the same block (e.g. {hello|hi}) is used in level 1 and then in higher levels. #4

Open
far4599 opened this issue May 12, 2021 · 1 comment

Comments

@far4599
Copy link

far4599 commented May 12, 2021

Hi, i came across the bug that this package spins text like this with invalid result:

original string:
The {slow|quick} {brown|blue and {red|yellow}} {fox|deer} {gracefully |}jumps over the {{slow|quick} {fox|deer}}

result:
The slow blue and yellow fox jumps over the deer}

The problem is that on level!=1 you used block replacement in the original string. So when we are in nested block "{{slow|quick} {fox|deer}}" this replacement is applied to the first occurrence of "{slow|quick}" in the original string.

I've made a fix and will provide pull request soon.

far4599 added a commit to far4599/gospin that referenced this issue May 12, 2021
@far4599
Copy link
Author

far4599 commented May 12, 2021

Sorry, I don't know how to link this issue with the pull request.)

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

No branches or pull requests

1 participant