import xhtm from 'xhtm'
import vhtml from 'vhtml'
const html = xhtm.bind(vhtml)
const markup = html`<p>this < that</p>`
console.log(markup)
Error
file:///var/home/aral/sandbox/xhtm/node_modules/xhtm/htm.js:100
const err = (msg) => { throw SyntaxError(msg) }
^
SyntaxError: Unclosed ``.
at err (file:///var/home/aral/sandbox/xhtm/node_modules/xhtm/htm.js:100:30)
at Function.htm (file:///var/home/aral/sandbox/xhtm/node_modules/xhtm/htm.js:95:14)
at file:///var/home/aral/sandbox/xhtm/index.js:6:20
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
Node.js v19.6.0
Suggested workaround
While <p>this < that</p> is not valid HTML, it is quite common to expect people to author HTML like this without thinking of escaping the less-than character during author time.
xhtm could escape solitary less-than characters in text content. i.e.,
Error
Suggested workaround
While
<p>this < that</p>
is not valid HTML, it is quite common to expect people to author HTML like this without thinking of escaping the less-than character during author time.xhtm could escape solitary less-than characters in text content. i.e.,
Thoughts? :)