This argument doesn't hold: nested anchors are not valid markup, so the browser is fixing it. 

This is what the program is trying to create, which is *illegal* markup:
```html
 <label class="danger">
   <input type="checkbox" value="1" />
   <span></span>
</label>
<a> <------
  <p>Test 
   <a href="http://google.com" data-url="google.com" target="_blank" data-action="url-link">google.com</a> <------
  </p>
</a><------
```

The browser is correcting the broken HTML, turning it into:

```html 
 <label class="danger">
   <input type="checkbox" value="1">
   <span></span>
</label>
<a>
  </a> <------
<p>
  <a>Test </a><a href="http://google.com" data-url="google.com" target="_blank" data-action="url-link">google.com</a> <------
</p>
```

Once you fix the markup please update the program to do all HTML markup transformations _before_ setting the innerHTML. 

Thank you.