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

Line breaks in pattern parameters #473

Closed
dennisfrank opened this issue Sep 11, 2016 · 10 comments
Closed

Line breaks in pattern parameters #473

dennisfrank opened this issue Sep 11, 2016 · 10 comments

Comments

@dennisfrank
Copy link

I am using Pattern Lab Node v2.5.1 on Mac, with Node v5.3.0, using a custom Grunt Edition.

Coming from Pattern Lab PHP I often format more complex pattern parameters with line breaks for better clarity. This seems to break the pattern include and nothing gets included at all:

{{> patternType-pattern(
    attribute1: value,
    attribute2: "value string",
    attribute3: "value string"
    ) }}
@uxmfdesign
Copy link

Having the same issue.

@bmuenzenmeyer
Copy link
Member

I'd start by playing with the regular expressions in each engine to recognize the new lines, if needed. Example: https://github.com/pattern-lab/patternengine-node-handlebars/blob/master/lib/engine_handlebars.js#L28-L30

they are used here: https://github.com/pattern-lab/patternlab-node/blob/master/core/lib/object_factory.js#L133

See what happens then. If things are still not working as expected after that, a second step may be needed on the parse side

@andrejilderda
Copy link

andrejilderda commented Jul 28, 2017

This would be a great improvement. I've also found that using () inside a pattern parameter causes the pattern to not receive any data. For example this does not work:
{{> molecules-pattern( title: "this is causing the issue ()") }}
This does work:
{{> molecules-pattern( title: "this is causing the issue") }}
Maybe this related or would you like me to add an issue for this?

@bmuenzenmeyer
Copy link
Member

this is likely a regex problem, and is a separate issue. thanks for the report!

@raphaelokon
Copy link
Contributor

@bmuenzenmeyer Do you want me to fix this?

@bmuenzenmeyer
Copy link
Member

@raphaelokon if you are referring to @ajilderda's comment, sure thing!

@bmuenzenmeyer bmuenzenmeyer added the hacktoberfest 🌾 https://hacktoberfest.digitalocean.com label Sep 28, 2017
@bmuenzenmeyer bmuenzenmeyer removed the hacktoberfest 🌾 https://hacktoberfest.digitalocean.com label Nov 10, 2017
@stale
Copy link

stale bot commented Jan 9, 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 Jan 9, 2018
@stale stale bot closed this as completed Jan 16, 2018
@bmuenzenmeyer bmuenzenmeyer added the pinned 📌 Don't let stalebot clean this up label Jan 16, 2018
@bmuenzenmeyer bmuenzenmeyer reopened this Jan 16, 2018
@stale
Copy link

stale bot commented Mar 17, 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.

@JosefBredereck
Copy link
Contributor

JosefBredereck commented Apr 29, 2020

Is this a related topic to mustache which is using a custom pattern reference?

Pattern

<p>{{text}}</p>
<p>{{text2}}</p>

Reference

{{> 
    pattern
    text="Hello"
    text2="Hello2"
}}

Result

<p>Hello</p>
<p>Hello2</p>

With handlebars, it is working right now. I don't know when the support for mustache will be dropped, so maybe still relevant.

@bmuenzenmeyer
Copy link
Member

this is a won't fix in the same vein as #145 - if the template language doesnt support it, we wont be doing it.

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

6 participants