HTML in values renders again
Text cells now render HTML from feed values (<b>, <p>, <a>, …) as formatting, like the card did before the TypeScript rewrite. Encoded entities such as & are decoded too. Fixes #92.
- Always sanitized. Only formatting tags and the
href,src,alt,title,widthandheightattributes are kept. Scripts, styles, event handlers and other tags are removed (their text is kept). - Links open in a new tab. In
add_linkcolumns, links inside the cell are removed to avoid nested links. template,prefixandpostfixcan carry markup too, e.g.prefix: "<b>".wrap_textoff: block tags like<p>and<ul>display inline, so cells stay on one line.
Heads up
- Plain text containing a bare
<may now display incorrectly, since it's read as HTML. - The bundle is larger (~91 KB, up from ~57 KB) because it now includes DOMPurify.
Thanks
Thanks to @PacFox for reporting #92 and testing the beta.
PR: #93