question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Escape Mustache / Handlebar delimiters when beautifying css

See original GitHub issue

Currently using the beautifier to pretty up the following css, with custom templating {{}} delimiters for a dynamic variable.

.box {
    display: flex;
    color: {{data.color}};
}

On Beautification it turns into this

.box {
    display: flex;
    color: {
            {
            data.color
        }
    }
}

I’m pretty sure that the ‘unformatted_content_delimiter’ option is what is needed to allow for {{token}} to be escaped from beautification, but i can’t find in the documentation how to specify it nor any examples.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bitwisemancommented, Apr 1, 2020

unformatted_content_delimiter is an html-only option.

Templating is not currently supported in css. Adding it is on the list of things to do, but it is a larger task than you’d expect.

0reactions
bitwisemancommented, Dec 1, 2020

@samueljim The problem is that the cssbeautifier handles text processing in a bunch of different places, rather than tokenizing everything first. This makes very hard to catch all the places where templating might be used. For example you’d catch a bunch here, but there’s a check for nested pseudoclass](https://github.com/beautify-web/js-beautify/blob/master/js/src/css/beautifier.js#L116) that would still get confused.

Read more comments on GitHub >

github_iconTop Results From Across the Web

js-beautify | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
https://raw.githubusercontent.com/beautify-web/js-...
... 'max\_preserve\_newlines' not working on beautify\_css.js CSS Beautifier ... Incorrect indentation of `^` inverted section tags in Handlebars/Mustache ...
Read more >
Easy HTML Templates with Mustache
In this tutorial you'll explore Mustache, a relatively new and very simple template system that you can easily use to create HTML templates....
Read more >
WVE - River Thames Conditions
Sippel reisen hofheim, Dave gorman tattoo youtube, Young beauty girl, ... Divert meaning in marathi, A href code css, Amasya simsim video izle, ......
Read more >
mustache - npm
Mustache is a logic-less template syntax. It can be used for HTML, config files, source code - anything. It works by expanding tags...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found