Widget order lab
Public Unreviewedby Ray
A deliberately awkward page for testing the markdown widget tag and section ordering (adom/wiki#152)
Contents
README
markdownWidget order lab
A deliberately awkward page, built for testing the markdown tag and section ordering shipped in adom/wiki#152. Nothing here is a real part page: it exists to be difficult.
Both paths are on this page. The tags below are markdown, in this README. The
sections named zulu, midway and alpha are page-owned HTML declared in
page.json, and zulu reaches the same pinout widget as a raw custom element
with its own script tag instead of a markdown tag. Declared order is
zulu, hero, readme, midway, info, alpha, which is scrambled on purpose: an HTML
section first, the built-ins interleaved, and the alphabetically-first file last.
What it exercises:
- Every registered widget, at least once
- The same widget twice on one page, with different data and different attrs
- Widgets between prose, not only under their own heading
- Two widgets back to back with no text between them
- A widget as the first thing after a heading, and as the last thing on the page
- An unregistered tag, which should render as nothing for a reader and a push hint for me
- A tag with a bogus attribute, which should be dropped rather than passed through
- Sections declared out of their natural order in page.json
A wide part, first thing under the heading
Two in a row, nothing between them
Both of these are on their own line, which is what the registry doc asks for, but they are in one markdown paragraph because there is no blank line between them. Neither renders, and both leak to the reader as literal text.
The control: the same two tags, one blank line apart
If these two render, the rule is not "its own line" but "its own paragraph", and the fix is either to match a tag inside a paragraph or to say so in the doc.
Interleaved with prose
The paragraph before a widget should not merge into it, and the paragraph after should not be swallowed. This sentence is the "before".
And this sentence is the "after", which should still be its own paragraph.
The same tag again, further down
The second instance of a widget on one page is where element re-registration would show up, if it were going to.
Things that should fail quietly
An unregistered tag, which a reader should never see:
A registered tag carrying an attribute that is not on its allowlist. The widget
should render, and onerror should be dropped rather than reaching the element:
Last thing on the page
A widget with nothing after it, in case trailing content is what keeps a frame sized correctly.