VueGWT / vue-gwt

Vue.js Components/Custom Elements in Java with GWT. Developed at https://www.genmymodel.com.
https://vuegwt.github.io/vue-gwt/
MIT License
204 stars 46 forks source link

Support invalid HTML in Components Templates #25

Closed adrienbaron closed 6 years ago

adrienbaron commented 6 years ago

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:

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>