简体   繁体   中英

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: 渲染视图

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

HTML 视图

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM