-
-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: #272 Credit: @SethFalco Close: #272 Reviewed-by: @isaacs
- Loading branch information
Showing
3 changed files
with
52 additions
and
16 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 was deleted.
Oops, something went wrong.
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,45 @@ | ||
// with entity | ||
require(__dirname).test({ | ||
xml: '<!DOCTYPE svg [ <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/"> ]><svg></svg>', | ||
expect: [ | ||
[ 'doctype', ' svg [ <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/"> ]' ], | ||
[ 'opentagstart', { name: 'SVG', attributes: {} } ], | ||
[ 'opentag', { name: 'SVG', attributes: {}, isSelfClosing: false } ], | ||
[ 'closetag', 'SVG' ], | ||
] | ||
}) | ||
|
||
// with comment | ||
require(__dirname).test({ | ||
xml: '<!DOCTYPE svg [<!--comment with \' and ] symbols-->]><svg></svg>', | ||
expect: [ | ||
[ 'comment', 'comment with \' and ] symbols' ], | ||
[ 'doctype', ' svg []' ], | ||
[ 'opentagstart', { name: 'SVG', attributes: {} } ], | ||
[ 'opentag', { name: 'SVG', attributes: {}, isSelfClosing: false } ], | ||
[ 'closetag', 'SVG' ], | ||
] | ||
}) | ||
|
||
// with entity and comment | ||
require(__dirname).test({ | ||
xml: '<!DOCTYPE svg [<!--comment with \' and ] symbols--> <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/"> ]><svg></svg>', | ||
expect: [ | ||
[ 'comment', 'comment with \' and ] symbols' ], | ||
[ 'doctype', ' svg [ <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/"> ]' ], | ||
[ 'opentagstart', { name: 'SVG', attributes: {} } ], | ||
[ 'opentag', { name: 'SVG', attributes: {}, isSelfClosing: false } ], | ||
[ 'closetag', 'SVG' ], | ||
] | ||
}) | ||
|
||
// with empty doctype | ||
require(__dirname).test({ | ||
xml: '<!DOCTYPE svg []><svg></svg>', | ||
expect: [ | ||
[ 'doctype', ' svg []' ], | ||
[ 'opentagstart', { name: 'SVG', attributes: {} } ], | ||
[ 'opentag', { name: 'SVG', attributes: {}, isSelfClosing: false } ], | ||
[ 'closetag', 'SVG' ], | ||
] | ||
}) |