Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Textangular dropping attributes on UL element

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?

like image 722
Josh Avatar asked Mar 17 '26 18:03

Josh


1 Answers

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

like image 140
coder2277 Avatar answered Mar 20 '26 06:03

coder2277



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!