mozilla-b2g/bleach.js — pull request #10 by jrburke (2014-10-31 23:03:09+00:00)
Title: Bug 1091310 - block-type tags inside a tags should be wrapped by the a tag

Most of the changes in this pull request are test file-related. The only substantive code change is removing 'a', from the `inline` makeMap list.

More notes in lib/bleach.js for the reasoning for choosing that fix.

These inline vs block distinction for closing tags is out of date with the parsing spec. For a while locally, I was running with just removing the entire block and inline lists and that inline/block comparison in the code, as I do not think it helps so much now. However, being more conservative in the changes are probably best for now.

For 'a' tags, by removing it from the inline map, which is only used for this "if current tag is a block, if previous is an inline, close it" test, the worse case outcome is that more of the message gets hyperlinked.

That is likely the result in an email client that is renders the HTML in a modern HTML renderer. For the gaia email app, we also ask the user before following a hyperlink, but bug 1082604 may change that behavior.