I agree HTML in its entirity is not a great way to store data, but a SUBSET of HTML is often pretty efficient.
Storing a paragraph where words might be bold or italic — a string of HTML’s pretty great for that, compared to some convoluted JSON thing, and can pretty easily be converted to other formats if needed.
Even a list of paragraphs with mixed occasional lists etc. HTML is still pretty friendly at that point.
I think where HTML strings outlive their usefulness is when you start mixing in <div> <iframe> <script>, nested sections. The string starts becoming unpredictable at that point and you have to worry about side effects.
But for use cases where you want a small whitelisted set of tags, I think HTML is great.
Storing a paragraph where words might be bold or italic — a string of HTML’s pretty great for that, compared to some convoluted JSON thing, and can pretty easily be converted to other formats if needed.
Even a list of paragraphs with mixed occasional lists etc. HTML is still pretty friendly at that point.
I think where HTML strings outlive their usefulness is when you start mixing in <div> <iframe> <script>, nested sections. The string starts becoming unpredictable at that point and you have to worry about side effects.
But for use cases where you want a small whitelisted set of tags, I think HTML is great.