nxus / templater

The template manager for Nxus applications
1 stars 0 forks source link

Fixed corruption of results from render() helper function. #27

Closed davidkellerman closed 3 years ago

davidkellerman commented 3 years ago

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.