posthtml / gulp-posthtml

PostHTML for Gulp
Other
18 stars 4 forks source link

Problems setting the Options object #8

Closed revelt closed 7 years ago

revelt commented 7 years ago

I'm working with email templates, which have to be in XHTML, so I need closing slashes on single tags.

However, when I set the options object:

var options = { closingSingleTag: 'slash' }

and use it:

.pipe(posthtml(plugins, options))

all my closing slashes are still removed. I raised and later closed an issue with PostHTML regarding this — it's not caused by PostHTML since its unit tests prove the settings do work.

I don't see any unit tests covering settings actually working.

Can somebody investigate, is it actually possible to set the closingSingleTag in gulp-posthtml?

thank you.

michael-ciniawsky commented 7 years ago

@revelt This one is my nemesis atm :) Jesus Christ..., there is something buggy in general 'somewhere', could you post your Gulp Config please and log the options {Object} out? (Otherwise please provide a test repo so I can do it myself 😛)

Scrum commented 7 years ago

@revelt Hi, this PR must closed this bug.

revelt commented 7 years ago

@GitScrum but it's not merged in yet, isn't it? should I wait until it's merged to 100% confirm?

Scrum commented 7 years ago

@revelt yep.

revelt commented 7 years ago

OK. If you guys see it's working feel free to close yourselves. I got fed up with this months ago and stopped using PostHTML completely. On the positive side, it made me produce quite few libs on npm.

Scrum commented 7 years ago

@revelt try

revelt commented 7 years ago

OK, I set it up again, no luck. Same as before, all slashes are still removed from all img tags.

plugins

slashes

I'm using { closingSingleTag: 'slash' } as options object. Maybe it's available only in posthtml-render where I took it from?

revelt commented 7 years ago

By the way I can't fulfil @michael-ciniawsky request and share Gulp settings since it's closed source.

I mean, if anybody's using gulp-posthtml, just try flipping your own Gulp plugin settings, to export singleton HTML tags with and then without the closing slashes. See what happens, see if you can get it working. Because I can't :(

var options = { closingSingleTag: 'slash' }
Scrum commented 7 years ago

@revelt i work on this, don't worry.

Scrum commented 7 years ago

@revelt Hi, i create demo and this work for me. Show me you case.

revelt commented 7 years ago

The test is missing plugins, that's where the trouble happens. I'll fork and supplement the demo with a plugin and some CSS via PR. Is that all right?

Scrum commented 7 years ago

Yep.

revelt commented 7 years ago

Done. Thanks for looking into this. The plugins seem the be "not seeing" the config, img is rendered without a slash in both cases after plugin processes the HTML.

Scrum commented 7 years ago

Thanks, I will investigate this.

Scrum commented 7 years ago

You lost actuar tree after call render. I create PR which fixed this

revelt commented 7 years ago

Aha! My bad. Thank you very much. Closing this.