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 plugin won't work correctly if there's any "body*" word in the content of the pug file.
E.g. in such case:
doctype html
html
head
meta(charset="utf-8")
title Bodyweight training
body
#root
it will generate:
doctype html
html
head
meta(charset="utf-8")
title link(href="css/app-f3c2fb29e007744ea4a5.css" rel="stylesheet")
Bodyweight training
body
#root
script(type="text/javascript"src="js/app-f3c2fb29e007744ea4a5.bundle.js")
It can be fixed by changing the regexp used from /( *)(%?body)/i to /^( *)(%?body)\b/im (in line #138).
I can prepare PR for it, but because there are no tests, I'm not sure if it won't break anything.
BTW. It might be a better idea to parse PUG using their parser to get AST and modify that instead using regexes, but then it would support only PUG files...
The text was updated successfully, but these errors were encountered:
szimek
changed the title
Breaks if there's word body anywhere in the content (not tag)
Breaks if there's word "body" anywhere in the content (not tag)
Apr 24, 2017
Thank you for your report and PR.
And I'm sorry for the late reply.
I will append examples and release new version.
It might be a better idea to parse PUG using their parser to get AST and modify that instead using regexes, but then it would support only PUG files...
This plugin won't work correctly if there's any "body*" word in the content of the pug file.
E.g. in such case:
it will generate:
It can be fixed by changing the regexp used from
/( *)(%?body)/i
to/^( *)(%?body)\b/im
(in line #138).I can prepare PR for it, but because there are no tests, I'm not sure if it won't break anything.
BTW. It might be a better idea to parse PUG using their parser to get AST and modify that instead using regexes, but then it would support only PUG files...
The text was updated successfully, but these errors were encountered: