-
Notifications
You must be signed in to change notification settings - Fork 580
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(xml-builder): xml entity encoding for more characters (#2309)
XML entity encoding for carriage return, line feed, next line, line separator characters, quote and single quote
- Loading branch information
1 parent
d52f7e6
commit 96ff164
Showing
3 changed files
with
14 additions
and
5 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { escapeElement } from "./escape-element"; | ||
|
||
describe("escape-element", () => { | ||
it("escapes: & < >", () => { | ||
const value = 'abc 123 &<>"%'; | ||
expect(escapeElement(value)).toBe('abc 123 &<>"%'); | ||
it("escapes: & < > \" ' \\n \\r \\u0085 \\u2028", () => { | ||
const value = "abc 123 &<>\"'%\n\r\u0085\u2028"; | ||
expect(escapeElement(value)).toBe("abc 123 &<>"'%

…
"); | ||
}); | ||
}); |
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