Markdown textarea

Is it possible to make a <textarea> tag and have it to be compatible with markdown

What you should do is convert the markdown to html first and then show it.
If your using node.js, some good solutions for this are ( which is exactly what I use.


@bruhdude1209, you can use a library like Marked which you can use in your browser.

<script src=""></script>

Then, in your code, you can call the marked() function which converts Markdown to HTML.

function convert() {
   let md = document.querySelector('textarea').value;
   let html = marked(md);

   console.log(html) // logs the markdown to HTML converted result

See for a working demo.

1 Like

Thats really cool! I should take note of that!

1 Like