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

Support HTML entities within pattern parameters #145

Closed
bmuenzenmeyer opened this issue Sep 10, 2015 · 9 comments
Closed

Support HTML entities within pattern parameters #145

bmuenzenmeyer opened this issue Sep 10, 2015 · 9 comments
Labels
enhancement ✨ pinned 📌 Don't let stalebot clean this up wontfix ⛔
Milestone

Comments

@bmuenzenmeyer
Copy link
Member

I tried putting some parentheses inside a pattern parameter string today and it did not work. We should be able to make these strings safer. Would help with passing in things like <strong>DANGER DANGER </strong> too

@bmuenzenmeyer bmuenzenmeyer changed the title Support HTML entities withing pattern parameters Support HTML entities within pattern parameters Sep 10, 2015
@bmuenzenmeyer bmuenzenmeyer added this to the v0.13.0 milestone Sep 20, 2015
@bmuenzenmeyer bmuenzenmeyer mentioned this issue Sep 20, 2015
@bmuenzenmeyer bmuenzenmeyer modified the milestones: v0.14.0, v0.13.0 Oct 6, 2015
@bmuenzenmeyer bmuenzenmeyer removed this from the v0.14.0 milestone Nov 6, 2015
@james-nash
Copy link
Contributor

I think this will get fixed by PR #293. Doing something like {{> pattern-name( foo: '<div class="bar">Look ma, HTML code!</div>' ) }} should then work. The only requirement would be to wrap your HTML value in quotes.
@e2tha-e : Would you agree? I could add a test for this if you like.

@bmuenzenmeyer
Copy link
Member Author

Great to hear!

james-nash pushed a commit to james-nash/patternlab-node that referenced this issue Mar 21, 2016
james-nash pushed a commit to james-nash/patternlab-node that referenced this issue Apr 11, 2016
@james-nash james-nash mentioned this issue Apr 11, 2016
@james-nash
Copy link
Contributor

Ok, just added a test to show that this issue no longer exists in PR #307

bmuenzenmeyer pushed a commit that referenced this issue Apr 12, 2016
* more accurate paramToJson in parameter_hunter

* updating unit tests for parameter_hunter paramToJson

* minor edit

* another param string parser

* bugs fixed, unit tests working

* variable name change

* Added (failing for now) test to highlight the bug.

* Added another test for another bug (parenthesis in value confuses patternhunter)

* Added additional parameter hunter tests.

* replacing JSON with JSON5 for better error messaging

* working paramToJson

* stricter unit tests

* comment updates

* simplfying paramToJson further

* simplfying paramToJson further

* comment update

* tightened parameter key search

* comment update

* accommodating decimals and exponentials as valid numeric values

* comment update

* fixing array instead of number typo

* more comments

* spacing to pass eslint

* removing unnecessary escape

* Fixed minor bug: Array instead of int used as substring() arg.

* Added parameter_hunter test to explicity show that issue #145 will now be fixed too.

* fixing substring param typo

* renaming json5 instances

* comment update

* Added comment in test code to reference issue #145
@bmuenzenmeyer
Copy link
Member Author

This is working like a dream - thanks you two!

@stale
Copy link

stale bot commented Oct 2, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the needs response label Oct 2, 2017
@bmuenzenmeyer bmuenzenmeyer added pinned 📌 Don't let stalebot clean this up and removed needs response labels Oct 2, 2017
@bmuenzenmeyer
Copy link
Member Author

bmuenzenmeyer commented Jan 15, 2018

We've regressed on this in v3. available on the dev branch or post alpha.6

@stale
Copy link

stale bot commented Mar 16, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the needs response label Mar 16, 2018
@bmuenzenmeyer bmuenzenmeyer added this to the 3.0.0 milestone Jun 8, 2018
@JosefBredereck
Copy link
Contributor

I was thinking if this is still an issue with the new feature of {{> @partial-block }} .
Also if you add {{{text}}} to your pattern and call it with handlebars it should also work as expected {{> pattern text="<strong>DANGER DANGER</strong>" }}

@bmuenzenmeyer
Copy link
Member Author

right - this is now a won't fix! if your pattern Engine of choice doesn't support this, use a more powerful one. We won't be propping up mustache any longer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ pinned 📌 Don't let stalebot clean this up wontfix ⛔
Projects
None yet
Development

No branches or pull requests

3 participants