Repository navigation
Conversation
Signed-off-by: AC <ac@fabtek.cn>
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.
Copying an element currently copies each attribute's owner pointer, so
copied.SelectAttr("p:id").Element()returns the original node. Namespace lookup after editing the copy still consults the original tree, and edits through that owner mutate the original. Document copies also leave top-level tokens attached to a temporary copied container, so removing a copied root does not remove it from the returned document.Rebind copied attributes to their new element, and rebind the document's direct tokens/attributes after embedding its copied container. Reset an isolated element copy's index to
-1, consistent with its nil parent.Regressions cover element/document copies, copied descendant attributes, namespace changes, edits through
Attr.Element(), top-level comments/processing instructions, removal of a copied root, and the detached root index. They fail before their fixes and pass afterward. Fullgo test ./...,go test -race ./...,go vet ./...,go build ./..., andgit diff --checkpass on Go 1.27.1 / Linux arm64. Other Go versions/platforms were not run locally.This is an independent branch from main; it does not include the implicit XML namespace fix in #159.
AI assistance: OpenAI Codex investigated, implemented, and ran these checks.