-
Notifications
You must be signed in to change notification settings - Fork 34
In HTML output mode, special handling for xmlns and xmlns:*.
#166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -317,6 +317,12 @@ function xmlElementLogicTrivial(node: XNode, buffer: string[], options: XmlOutpu | |
| continue; | ||
| } | ||
|
|
||
| // In HTML output mode, skip namespace declarations (xmlns and xmlns:*) | ||
| if (options.outputMethod === 'html' && | ||
| (attribute.nodeName === 'xmlns' || attribute.nodeName.startsWith('xmlns:'))) { | ||
| continue; | ||
| } | ||
|
Comment on lines
+320
to
+324
|
||
|
|
||
| if (attribute.nodeName && attribute.nodeValue !== null && attribute.nodeValue !== undefined) { | ||
| buffer.push(` ${xmlFullNodeName(attribute)}="${xmlEscapeAttr(attribute.nodeValue)}"`); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There’s a trailing whitespace after the
&&on theoptions.outputMethod === 'html' &&line; this will fail the repo’sno-trailing-spacesESLint rule. Remove the trailing space and let formatting place the line break without extra whitespace.