Skip to content

Support invalid HTML in Components Templates #25

@adrienbaron

Description

@adrienbaron

Vue GWT uses the greap JSoup project to parse HTML templates at compile time.
JSoup is very strict about the HTML syntax and implement a behavior similar to browsers.
In case of invalid HTML, the elements are just ignored.

This mean that this template:

<table>
    <tr>
        <my-component/>
    </tr>
</table>

Will be end up in this DOM tree at compile time (my-component element is dropped):

<table>
    <tr></tr>
</table>

JSoup doesn't seem to support a mode to allow invalid HTML, this mean that we either have to use another library, or fork JSoup and change it to allow this.

The new library should support the following:

  • Keep invalid HTML element when parsing
  • Support case on attribute name
  • Support modifying the DOM tree
  • Support reexporting the DOM tree to HTML

For now a workaround to this is to use the is attribute from Vue.js that exists to go around this issue in browsers:

<table>
    <tr>
        <td is="my-component"/>
    </tr>
</table>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions