gjtorikian / html-pipeline

HTML processing filters and utilities
MIT License
2.27k stars 380 forks source link

Whitelist various inline semantic/formatting tags #306

Closed chris-morgan closed 5 years ago

chris-morgan commented 5 years ago

Mostly I want <abbr>, but the rest of these should also be whitelisted.

What goes in LIMITED.elements seems to be a bit subjective, but I think that <mark> and <abbr> at least are reasonably justified. <dfn> is fairly obscure, and <small>, <bdo>, <cite>, <span>, <time> and <wbr> a bit different from the rest and probably not justified, so I left them out.

In the absence of styling, <span> is quite useless, but <div>’s there already, and people have asked for <span> (#183), so I figured, why not?

Fixes #183.

gjtorikian commented 5 years ago

Seems reasonable, thank you for your contribution.

gjtorikian commented 5 years ago

This is out now as 2.9.2.

bpj commented 5 years ago

Spans are not entirely useless without styling. They can be given an id an used as anchors. This is useful e.g. in Pandoc which has a native span syntax. Besides <a name=...> has been deprecated for ages.

chris-morgan commented 5 years ago

True, though I think normally you want to put the ID on something else (typically a heading). I had forgotten about that use case.