3

I have the following HTML that I pull from a database and send to a view with a Text Angular control:

<ul class="support">
  <li class="lineitem">Hello world</li>
</ul>

When I first load the page, it appears correct: Rendered View

When I switch to HTML view, the attributes on the UL element get dropped and the element hangs open:

HTML View

This happens for any attributes added to the UL element, ID, name, etc. What do I need to set in order to allow attributes on the UL element?

Josh
  • 10,352
  • 12
  • 58
  • 109

1 Answers1

2

It's a bug. You can fix it with changing row in source code https://github.com/textAngular/textAngular/blob/ff8e48087f780d30f54e77b06f09e0b85f9517e9/dist/textAngular.js#L2132

Original:

_html += _repeat('\t', tablevel-1) + listNode.outerHTML.substring(0, 4);

Replace with:

_html += _repeat('\t', tablevel - 1) + listNode.outerHTML.substring(0, listNode.outerHTML.indexOf('>') + 1);

There is a fork you can use and that has an open PR: https://github.com/textAngular/textAngular/pull/1573

Antoine
  • 3,880
  • 2
  • 26
  • 44
coder2277
  • 21
  • 4