When there's interpolated variables, the templates break
See original GitHub issueHey, we’re a SF company and we use your library, we’re pretty happy with it keep up the good work!
There’s something we noticed:
When there’s an interpolated variable like <p class="paragraph" style="background: {{color}]>hello</p>
, the styles from the class won’t be part of the style attribute, and also this breaks the inline styles of other <p>
tags in the same template, they don’t get the styles either.
Issue Analytics
- State:
- Created 7 years ago
- Comments:19 (10 by maintainers)
Top Results From Across the Web
string interpolation - format string output - Microsoft Learn
When an interpolated string is resolved to a result string, items with interpolation expressions are replaced by the string representations of ...
Read more >String interpolation on variable - javascript - Stack Overflow
var template = function(tpl, args) { var keys = Object.keys(args), ... It is likely to be very slow and break down on lots...
Read more >Template literals (Template strings) - JavaScript | MDN
Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded ...
Read more >String interpolation - Wikipedia
In computer programming, string interpolation is the process of evaluating a string literal containing one or more placeholders, yielding a result in which ......
Read more >Interpolating Functions and Expressions Within Strings - O'Reilly
This lets you construct more complex templates than with simple scalar variable interpolation. Solution. You can break up your expression into distinct ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
New version is out with this feature 7cdc0dd7f6df9516f488d1858703bff79a6e7478.
Here’s the updated docs on how to use it.
https://github.com/jonkemp/inline-css#optionscodeblocks
Closing.
I agree, this is probably a feature request, and yes that was a typo