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.
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:
After replacing id with strings.Replacer:
After replacing id with fasttemplate.ExecuteStringStd:
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