observablehq / htl

A tagged template literal that allows safe interpolation of values into HTML, following the HTML5 spec
https://observablehq.com/@observablehq/htl
ISC License
305 stars 24 forks source link

Use raw input. #13

Closed mbostock closed 4 years ago

mbostock commented 4 years ago

This currently throws a confusing TypeError: Cannot read property 'length' of undefined.

html`this is not valid \unicode`

Per this precedent

https://exploringjs.com/es6/ch_template-literals.html#sec_html-tag-function-implementation

I believe hypertext literal should favor the raw input instead of allowing embedded unicode escapes.