dart-lang / html

Dart port of html5lib. For parsing HTML/HTML5 with Dart. Works in the client and on the server.

Home Page:https://pub.dev/packages/html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<font/> like tag parse error

kuro7766 opened this issue · comments

dart html parse err

example:
<red/>lll

Pseudo code

  log(61, 'to parse : ' + text);
  h.DocumentFragment document = parseFragment(text);
  var t = 0;

  document.nodes.forEach((element) {
    t+=1;
    //this is parent
    log(61, "$t : " + element.text + ',${element?.children?.length}, ${element.toString()}' + ',' + element.runtimeType.toString());
    //this is children
    element.nodes.forEach((element) {
      log(63, "$t : " + element.text + ',${element?.children?.length}, ${element.toString()}' + ',' + element.runtimeType.toString());
    });

log

61 is parent and 63 is child
----------------------------------------------------------
61 : to parse : <red/>lll
61 : 1 : lll,0, <html red>,Element   //this is parent element parse result
63 : 1 : lll,0, "lll",Text    //this is child element parse result

The issue is

lll shouldn't be parsed as <red>'s child