Conversation
…s (GH #234) Users commonly expect toString(1) to produce indented output on any parsed document, but the formatter only inserts indentation between child elements that are not already separated by text content. Add a note to the Document toString documentation explaining that no_blanks => 1 is needed at parse time to strip existing whitespace text nodes before re-indentation can take effect.
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.
What
Add documentation clarifying that
toString($format)only re-indents output when whitespace-only text nodes are absent.Why
Users commonly expect
toString(1)to pretty-print any parsed document (see GH #234, StackOverflow #7215316). The formatter respects existing text content, so documents parsed with default settings retain their original whitespace text nodes, preventing re-indentation. nwellnhof confirmed this is the intended libxml2 behavior.How
Added a note to the Document
toStringsection indocs/libxml.dbkexplaining the interaction with whitespace text nodes, with a code example showingno_blanks => 1at parse time. Regeneratedlib/XML/LibXML/Document.pod.Testing
make pod_docsregenerates cleanlyRef: #234
Quality Report
Changes: 2 files changed, 45 insertions(+)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan