Converting Plain Text To Encoded HTML With Vanilla JavaScript<\/h1>\nAlexis Kypridemos<\/address>\n 2024-04-17T13:00:00+00:00
\n 2024-04-18T21:05:28+00:00
\n <\/header>\n
When copying text from a website to your device\u2019s clipboard, there\u2019s a good chance that you will get the formatted HTML when pasting it. Some apps and operating systems have a \u201cPaste Special\u201d feature that will strip those tags out for you to maintain the current style, but what do you do if that\u2019s unavailable?<\/p>\n
Same goes for converting plain text into formatted HTML. One of the closest ways we can convert plain text into HTML is writing in Markdown as an abstraction. You may have seen examples of this in many comment forms in articles just like this one. Write the comment in Markdown and it is parsed as HTML.<\/p>\n
Even better would be no abstraction at all! You may have also seen (and used) a number of online tools that take plainly written text and convert it into formatted HTML. The UI makes the conversion and previews the formatted result in real time.<\/p>\n
Providing a way for users to author basic web content — like comments — without knowing even the first thing about HTML, is a novel pursuit as it lowers barriers to communicating and collaborating on the web. Saying it helps \u201cdemocratize\u201d the web may be heavy-handed, but it doesn\u2019t conflict with that vision!<\/p>\n
\n 2024-04-18T21:05:28+00:00
\n <\/header>\n