squirrellyjs / squirrelly

Semi-embedded JS template engine that supports helpers, filters, partials, and template inheritance. 4KB minzipped, written in TypeScript ⛺
https://squirrelly.js.org
MIT License
634 stars 83 forks source link

Parsing error with escaped single quotes on template #118

Closed tabarra closed 5 years ago

tabarra commented 5 years ago

Describe the bug When trying to render a template that contains an escaped single quote (\') squirrelly throws a SyntaxError.

To Reproduce Consider the following code:

const sqrl = require('squirrelly');
let tpl = `aaa\\'bbb`;
console.log(sqrl.Render(tpl, {}));

Expected Output

aaa\'bbb

Screenshots https://i.imgur.com/xTvEhlL.png

Additional context Tested on v7.2.1 and v7.1.3

nebrelbug commented 5 years ago

Alrighty @tabarra, this should be fixed with release 7.3.0 :smiley:

Let me know if this works! 👍

I was also able to reduce the minified size of Squirrelly to 5kb minified and 2.2kb minzipped with the latest release (https://bundlephobia.com/result?p=squirrelly@7.3.0)