-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec5ce84
commit 30c9bcf
Showing
13 changed files
with
118 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
const {VALUE} = require('../shared/symbols.js'); | ||
const {emptyAttributes} = require('../shared/attributes.js'); | ||
const {Attr} = require('./attr.js'); | ||
const {escape} = require('html-escaper'); | ||
|
||
/** | ||
* @implements globalThis.Attr | ||
*/ | ||
class XmlAttr extends Attr { | ||
constructor(ownerDocument, name, value = '') { | ||
super(ownerDocument, name, value); | ||
} | ||
|
||
toString() { | ||
const {name, [VALUE]: value} = this; | ||
return emptyAttributes.has(name) && !value ? | ||
name : `${name}="${escape(value)}"`; | ||
} | ||
} | ||
exports.XmlAttr = XmlAttr |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {VALUE} from '../shared/symbols.js'; | ||
import {emptyAttributes} from '../shared/attributes.js'; | ||
import {escape} from 'html-escaper'; | ||
import {Attr} from './attr.js'; | ||
|
||
/** | ||
* @implements globalThis.Attr | ||
*/ | ||
export class XmlAttr extends Attr { | ||
constructor(ownerDocument, name, value = '') { | ||
super(ownerDocument, name, value); | ||
} | ||
|
||
toString() { | ||
const {name, [VALUE]: value} = this; | ||
return emptyAttributes.has(name) && !value ? | ||
name : `${name}="${escape(value)}"`; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* @implements globalThis.Attr | ||
*/ | ||
export class XmlAttr extends Attr implements globalThis.Attr { | ||
} | ||
import { Attr } from "./attr.js"; |
This file contains 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
This file contains 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
This file contains 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