The render() helper function uses the string replace() method to insert its rendered results in the output string. Unfortunately, the replace() method checks for replacement patterns in the replacement string, and modifies the string if any are present. So, if the rendered results happen to contain content that looks like a replacement pattern, bad things happen.
Tweaked the .replace() invocation to deliver the replacement string with a function, which suppresses replacement pattern processing.
The
render()
helper function uses the stringreplace()
method to insert its rendered results in the output string. Unfortunately, thereplace()
method checks for replacement patterns in the replacement string, and modifies the string if any are present. So, if the rendered results happen to contain content that looks like a replacement pattern, bad things happen.Tweaked the
.replace()
invocation to deliver the replacement string with a function, which suppresses replacement pattern processing.