Conversation
…ng serialization Covers: - Leaf nodes: NewText, NewComment, NewCData - Void elements: all 16 standard HTML void elements serialise as self-closing - Non-void elements: empty, text-only (inline), element children (indented) - Indentation: per-level 2-space indent; element vs. text-only sibling behaviour - Attributes: single, multiple, name lower-casing - HtmlDocument: with/without DOCTYPE, multiple root elements, empty element list - Round-trip: manually-constructed node serialises then parses back correctly 25 tests pass (net8.0). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…3 to resolve GHSA-g94r-2vxg-569j Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Commit pushed:
|
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This is an automated pull request from Repo Assist, an AI assistant for this repository.
Summary
Adds 25 comprehensive unit tests for
HtmlNode.ToString()andHtmlDocument.ToString()serialization in a new dedicated test fileHtmlNodeSerialization.fs.These tests provide regression coverage for the serialization behaviour (especially important alongside the perf changes in the companion PR for
isVoidElementandnewLine) and document the exact semantics of the serializer.Tests Added
Leaf nodes (4 tests)
NewText→ content stringNewText→ empty stringNewComment→<!-- ... -->NewCData→<![CDATA[...]]>Void elements (3 tests)
area,br,imgwith attributes)<name />Non-void elements (4 tests)
<div></div>Indentation and sibling behaviour (2 tests)
Attributes (4 tests)
HtmlAttribute.NewNewElementHtmlDocument.ToString()(5 tests)<!DOCTYPE ...>prefix<!DOCTYPE html>\nprefixRound-trip (1 test)
Test Status
(2980 pre-existing + 25 new)