Markdown in HTML
Is there a HTML tag that processes markdown? I know that there is a way to do it with JS, but can you do it just with HTML?
For code, you can use a syntax highlighter.
@Baconman321 Since when is creating a markdown parser from scratch that fully conforms to the MD specification quite easy.
Btw, the parser I've used was this one; very easy setup.
(Example of use in real Repl: https://repl.it/@EpicGamer007/HackTalk#modules/md.mjs)
Well... you can target the DOM:
const div = document.body.querySelector("div[markdown='1']"); const parser = new DOMParser; const input = div.textContent; const output_document = parser.parseFromString("text/html", parseMarkdown(input)); const output_element = output_document.documentElement; div.replaceWith(output_element);
No, because HTML is itself a markdown language (hence the name HyperText Mark