Typeset
Typeset copied to clipboard
HTML Entities are turned into actual characters
trafficstars
I have HTML with entities like < and > in it and when I pass this HTML through typeset, they are replaced with the actual < and > characters and so my HTML comes up incorrect. Check out the following example:
console.log(typeset(`
<!doctype html>
<html lang="en">
<p>Hello <there> you!</p>
`.trim()));
This produces the following output:
<!DOCTYPE html><html lang="en"><head></head><body><p>Hello <there> you!</there></p></body></html>
The < and > around the word there have now turned it into a <threre> tag, with a closing tag as well just before </p> in the final output.
Here's a REPL demonstrating this test case: https://repl.it/@sharat87/BigheartedDefiantCones
Thank you very much for your work.
Hey @sharat87, thanks for your contribution. I'll have a look this coming weekend.