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

Add option to forward options to posthtml-expressions plugin #78

Merged
merged 3 commits into from
May 3, 2022

Conversation

citrus
Copy link
Contributor

@citrus citrus commented Dec 9, 2021

I came across a situation where I needed to use custom delimiters in my html, so I added an option to forward options to posthtml-expressions.

Available options here: https://github.com/posthtml/posthtml-expressions#options

// module: <div><i>%[ foo ]%</i><b>{{ ignored }}</b></div>
const template = `<module href="./test/module.html" locals='{"foo":"bar"}'></module>`;
const html = await posthtml().use(plugin({ 
  expressions: { 
    delimiters: ['%[', ']%'] 
  } 
})).process(actual).then(result => clean(result.html));

console.log(html)
// <div><i>bar</i><b>{{ ignored }}</b></div>

@cossssmin cossssmin requested a review from Scrum December 11, 2021 21:26
@Scrum
Copy link
Member

Scrum commented Apr 6, 2022

@citrus thank you very much. Could you add a description about this to the readme.md?

@citrus
Copy link
Contributor Author

citrus commented Apr 15, 2022

@Scrum Good call out. I've added this option to the readme.

@cossssmin
Copy link
Member

Thanks for this @citrus (and sorry for the delay!).

@Scrum tests pass, can you please merge and publish a new release? Thanks!

@cossssmin
Copy link
Member

cossssmin commented Apr 26, 2022

Actually @citrus can you please rename the posthtmlExpressionsOptions option to just expressions?

This way it's consistent with other PostHTML plugins, like posthtml-extend. Thanks!

@citrus
Copy link
Contributor Author

citrus commented Apr 26, 2022

Actually @citrus can you please rename the posthtmlExpressionsOptions option to just expressions?

This way it's consistent with other PostHTML plugins, like posthtml-extend. Thanks!

done & done!

@cossssmin
Copy link
Member

Thanks, looks good to me! Let's wait for @Scrum to review and merge/release a new version 👍

@citrus
Copy link
Contributor Author

citrus commented Apr 26, 2022

Thanks, looks good to me! Let's wait for @Scrum to review and merge/release a new version 👍

Sounds good! Let me know if anything needs to be adjusted.

@cossssmin
Copy link
Member

Going to merge this now, as we have more issues to attend to (#86) and we'll release a new version with those fixes included, sorry!

@cossssmin cossssmin merged commit 336e926 into posthtml:master May 3, 2022
@Scrum
Copy link
Member

Scrum commented May 4, 2022

@citrus @cossssmin Thanks guys, now available in version 0.9.0

@citrus citrus deleted the posthtml-expressions-options branch May 4, 2022 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants