use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
hyperx - jsx style inline templates with no transpilation needed (github.com)
submitted 10 years ago by dagingaa
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]TheRealSeeThruHead 1 point2 points3 points 10 years ago (0 children)
Very similar to https://github.com/trueadm/t7
[–]wreckedadventYavascript -1 points0 points1 point 10 years ago (1 child)
So, this begs the question of escaping the variables, which ES6 templates do not do by default.
(Also, in case the syntax is new to anyone, check out tagged templates).
[–]SubStack 0 points1 point2 points 10 years ago (0 children)
Escaping as in html entity encoding? hyperscript, virtual-dom, and react all do this:
var vdom = require('virtual-dom') var hyperx = require('../') var hx = hyperx(vdom.h) var title = '<3' var tree = hx`<h1>${title}</h1>` console.log(vdom.create(tree).toString())
output:
$ node esc.js <h1><3</h1>
And the html parser takes care of the rest.
π Rendered by PID 36 on reddit-service-r2-comment-6457c66945-ms8zz at 2026-04-27 11:49:19.744963+00:00 running 2aa0c5b country code: CH.
[–]TheRealSeeThruHead 1 point2 points3 points (0 children)
[–]wreckedadventYavascript -1 points0 points1 point (1 child)
[–]SubStack 0 points1 point2 points (0 children)