sinedied / backslide

:sweat_drops: CLI tool for making HTML presentations with Remark.js using Markdown
https://sinedied.github.io/backslide
MIT License
764 stars 50 forks source link

Split and reassamble markdown at </script> #52

Closed jldiaz closed 5 years ago

jldiaz commented 5 years ago

After JSON.stringifying the whole md, it is cut in chunks at the / in each , and reassambled as sum of strings. For example if the resulting string would be:

"This contains <script>foo</script> tags"

It would be converted to:

"This cointains <script>foo<" + "/script> tags"

The resulting string is the same, but being cut this way the browser is no longer confused by the </script> inside the code.

sinedied commented 5 years ago

Thanks for the proposal, but a simpler fix has already been merged in branch feature/refactor, see https://github.com/sinedied/backslide/blob/feature/refactor/lib/processings/transform.js#L50

Since the refactoring is taking more time than expected initially, I will find some time to backport this small fix in the main branch in the meanwhile, sorry for the inconvenience/