Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed HTML generated #15

Open
arnaumanyosa opened this issue Mar 20, 2018 · 1 comment
Open

Malformed HTML generated #15

arnaumanyosa opened this issue Mar 20, 2018 · 1 comment

Comments

@arnaumanyosa
Copy link

gulp-posthtml runs with no errors but generates malformed HTML only in Ubuntu

Details

I use gulp-posthtml in my Polymer project to strip the CSS from a component and apply autoprefixer, like this

...
.pipe(gulpif(/\.html$/, postHtml([postHtmlPostCss([autoprefixer('last 2 versions')])])))
...

On MacOS 10.13.2 everything works perfectly. But if I run exactly the same on a Jenkins setup I have detected that gulp-posthtml generates some malformed HTML:

The original part of the code (part of an iron-ajax call)
body='{"start":[[startingItem]], "count":[[itemsPerPage]], "query": "[[query]]"}'

The part of the code generated on MacOS (html works)
body="{"start":[[startingItem]], "count":[[itemsPerPage]], "query": "[[query]]"}"

The code generated by Jenkins (on an Ubuntu 16)
body="{" start":[[startingitem]],="" "count":[[itemsperpage]],="" "query":="" "[[query]]"}"=""

Notice the space added before start and the ="" in several positions

Environment

MacOS environment

OS node npm/yarn package
MacOS 10.13.2 8.10.0 5.6.0 3.0.0

Jenkins environment

OS node npm/yarn package
Ubuntu 16 8.10.0 5.6.0 3.0.0
@Scrum
Copy link
Member

Scrum commented Mar 20, 2018

@arnaumanyosa this is due to the incorrect operation of the parser which is used in posthtml-parser.

For now, it's better to escaped all incoming html data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants