Harden handling of BR tags

BR tags would produce artefacts with "data-attribute" attributes. This is
partly due to the fact, that br sometimes comes without trailing <SPACE>/.
The change makes the regex flexible enough to handle that case. Also, it
cleans up dirty code with nested data-attributes.

Change-Id: I035bcc7332c981450648b1ba258255ecc31b8478
Merge "Harden handling of BR tags"