folding template strings
See original GitHub issueThe default regex will not handle things like
<div className={`p-1 ${big ? "mt-6" : "mt-0"}`}>
Anyway to handle this nicely?
I tried combining a “string regex” with a “template string” regex unforunately that puts the relevant result of the second regex in group 5 instead of group 2 as the first.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:29 (17 by maintainers)
Top Results From Across the Web
Template Strings - TypeScript Deep Dive - Gitbook
The motivation of Template Literals is three fold: String Interpolation. Multiline Strings ... They have since been officially renamed to template literals.
Read more >ES6 template string codes folded wanted! #57124 - GitHub
ES6 template string codes folded wanted!
Read more >Template strings in F#? - Stack Overflow
If you have a dynamic list of substitutions, you can achieve what Template() does with a simple fold: let substitutions = [("who", "tim");...
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 >JavaScript Template Strings - David Walsh Blog
Seemingly every language has a template string enhancement, and within JavaScript we've written our own to ... CSS 3D Folding Animation.
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
@e-medeiros thanks for testing 😃 The problem with react syntax is that it can have any attribute value as there’s no compiler to parse the value. It’s just the browser engine that renders the value as it is, and you can basically concat anything. In this case you will have to make the regex greedy, but that means any following attribute will be matched as well. When you make the regex lazy then it will stop when it encounter any of ending characters.
I will have some time next week to look into away to workaround this.
@moalamri worked fine with 0.1.5