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

make ExecuteStringStd to be compatible to strings.Replacer on nested tags #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DoubleDi
Copy link
Contributor

Hi @valyala!
In #23 we added ExecuteStringStd which works as a drop-in replacement to strings.Replacer.
It worked great, but we found a missmatch on nested start/end tags.
Here is an example:

{"x":"{id}"} 

After replacing id with strings.Replacer:

{"x":"1"} 

After replacing id with fasttemplate.ExecuteStringStd:

{"x":"{id}"}

The reason is because fasttemplate takes the first start tag it finds, but strings.Replacer takes the closest to the end tag.
So i made a PR to change the logic only in the ExecuteStringStd and other *Std funcs to make them compatible with strings.Replacer.

Please review when you have the time

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 this pull request may close these issues.

1 participant