Steps to reproduce:
1. In Modeler, create a pp Page Provider.
2. In Designer, configure the results layout for pp.
3. Switch to code.
4. At the end of the template, instead of closing nuxeo-data-table and nuxeo-results in different lines:
Change it so they close in the same line:
6. Switch to view.
7. Edit the table.
8. Switch to Table Editor.
9. Notice how changes are no longer persisted in this editor. Not only that, the editor won't give you any feedback that it isn't saving your work, you'll only notice it once you try to open the Table Editor later. When checking the browser console, there are several instances of Uncaught (in promise) TypeError: Cannot read property 'nodeName' of undefined.
Why is this problem relevant?
Allowing users to switch to code to make changes in the layout can introduce this sort of problems. For the provided reproduction steps, the changes in the layout don't really change it's structure, but are enough to break the editor. We have to keep in mind that users might want to use a formatting structure that is different than what we currently support.
What can we do?
For now, the purpose of this ticket is to understand if something can be done in order to properly parse the HTML, regardless of formatting. If that cannot be achieved, when the HTML can't be parsed properly, a message should be shown to the user, warning him/her that there's something wrong.