You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a kind of specific case, but the generated javascript prints $ while the original semantics was to print $$. This is caused by replaceAll interpreting the $ in the replacement string as capture groups, even when the search is not a regex. So it can actually only be used when the replacement is a text literal that doesn't contain a dollar. Otherwise the split + join trick should be used.
Alternatively, we could add a flag to the Text type (could also be useful for shorter replacement code in Lua) but that seems like an overkill.
The text was updated successfully, but these errors were encountered:
Playground link
This is a kind of specific case, but the generated javascript prints
$
while the original semantics was to print$$
. This is caused byreplaceAll
interpreting the$
in the replacement string as capture groups, even when the search is not a regex. So it can actually only be used when the replacement is a text literal that doesn't contain a dollar. Otherwise thesplit
+join
trick should be used.Alternatively, we could add a flag to the Text type (could also be useful for shorter replacement code in Lua) but that seems like an overkill.
The text was updated successfully, but these errors were encountered: