GX2020: element in a parent where a browser moves or drops it
An element is inside a parent that HTML does not allow, so the parser of the browser changes the tree.
Cause
The parser of a browser repairs some markup. It ends a p before a div, a list or a heading. It moves or drops a tr with no table, a td with no row and a li with no list. The page then has a different tree from the .gx file: a style or a patch does not find its element, and a morph changes the wrong one.
Gx reads one file. An element at the top of a component has no finding, because its parent is in a different file.
Example
package note
<p class="note">
Read this first.
<div class="box">A box</div>
</p>gx check reports:
note/Note.gx:5:3: GX2020: the <div> is inside a <p>: a browser ends the paragraph before itFix
- In a paragraph, use
spanfor a box of text. Or make the paragraph adiv. - Put a
liinsideul,olormenu. Put atrinsidetable,thead,tbodyortfoot, and atdinside atr.