reesemclean/blueprint

nesting {{helper name}} within {} causes parsing error

Closed this issue · 6 comments

G'day mate! Thanks for the insanely useful plugin, its awesome!

However I can't get the pascalHelper to add my filename as my CSS class name (CSS Modules), have pictured below. Any suggestions, did I miss something obvious? Appears to be an issue with nesting the helper moustache within another set of curly braces?

Cheers,

Mick

screen shot 2018-06-25 at 5 25 49 pm

screen shot 2018-06-25 at 5 26 01 pm

Hmmm, okay, it works with a space added after the helper moustache:

<div className={ styles.{{pascalCase name}} }>

I can live with that :)

A suggestion! How about allowing use of VSCode user snippets in the template files? e.g. provide a placeholder for snippet names in the templates: {{snippetName: blahblah}}. That way the templates could be made as snippets including the curser positioning functions etc...

Still an issue really... Adding a space before and after the enclosing curly braces does solve the parsing issue however it results in compiled format of className={ styles.FileName } which STANDARD Linting dislikes (and I agree):
screen shot 2018-06-29 at 1 32 02 pm

Here's the solution: http://handlebarsjs.com/expressions.html#whitespace-control

<div className={styles.{{pascalCase name~}} }>

☝️ should do it. The ~ tells it to remove the whitespace the tag is replaced! Gonna close this out.