Skip to content

Treat <ol> like <ul> when parsing as HTML#23

Open
cyanogilvie wants to merge 4588 commits intotDOM:masterfrom
RubyLane:master
Open

Treat <ol> like <ul> when parsing as HTML#23
cyanogilvie wants to merge 4588 commits intotDOM:masterfrom
RubyLane:master

Conversation

@cyanogilvie
Copy link
Copy Markdown

<ol>
<li>first
<li>second
</ol>

was failing to parse with -html set. This patch adds the <ol> tag to the set that trigger autoclose.

I also added test cases to highlight the incorrect nesting of the <li> child nodes when this doc is parsed.

rolf and others added 29 commits February 24, 2025 17:10
…t feature turned out to be cumbersome and with unwanted fall out so this first backs out this to perhaps find something better.
…e that (with first looking at the selectNodesNamespaces mapping for full control) and error out if it doesn't resolve. Still to decide what to do with XML namspace declaration attributes.
…ripts. There are corner cases in really pathological scenarious but for a broad range of practical needs this should work pretty well and intuitively.
…at build time. Added tests regarding the nodeList argument of scriptend XPath functions.
…res. Thanks to Peter Piwowarski for his valuable input.
Added test cases exercising the html parsing of <ul> and <ol>.

Currently they still fail because <ul><li>first<li>second</ul> is interpreted as
<ul><li>first<li>second</li></li></ul> instead of
<ul><li>first</li><li>second</li></ul>
…rror, don't add the node or set the result to the nodecmd
…y will be spurious text nodes in the resulting DOM
Add domSetAttributeEx (length-explicit variant of domSetAttribute)
to dom.c, and expose it along with tcldom_createNodeObj, domCloneNode,
domCreateDoc, domCreateDocument, domSetDocumentElement, domFreeDocument,
domNewElementNode, domAppendNewTextNode, and domAppendChild via the
stubs table (slots 19-28).

Update test expectations for HTML serialization newline suppression
and mark li auto-close tests as knownBug.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant