-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Implement tagged template string #103
Comments
IMO this is not a priority until more browsers support tagged template strings natively. Some changes in thinking and details since I wrote that gist:
|
Do tagged template strings not work properly with a transpiler like Babel? |
I don't know whether Babel supports creation of arbitrary new tag functions. Would be happy to hear/see more info about this. Of course, you can and probably should use Babel today to get raw multiline strings for more convenient use with XRegExp. No changes to XRegExp are needed for that. If the |
@slevithan A tagged template literal is just another way of making a function call: the first parameter is an Array with the static parts of the template literal, the remaining parameters are the dynamic Thus, you can even write tag functions in ES5. More info: http://exploringjs.com/es6/ch_template-literals.html#_implementing-tag-functions |
It's perfectly possible to use |
Just chiming in to add that I'm most interested in seeing a special tag in XRegExp so that interpolated strings can be escaped. A Until XRegExp supports escaping via a tag, I'll continue my search for a tag function that escapes interpolated strings for use in regular expressions. |
Over at OctoLinker/OctoLinker#282, I've made some progress on an Note that template literals are now supported natively in most browsers except IE, but Babel can transpile them down to regular function calls (as mentioned above), so they can work in IE as well. |
Yes, interested. |
As per your gist from 2012: https://gist.github.com/slevithan/4222600
The text was updated successfully, but these errors were encountered: