Skip to content

Commit b638dd3

Browse files
author
Alexis Aubry Radanovic
committed
Reflect new Unicode escaping strategy in tests
1 parent 9cc2bf9 commit b638dd3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
- Further improved the escaping algorithm, which is now up to 6 times faster.
1212
- Changed the escaping strategy: special characters are now escaped with decimal sequences. This allows for better compatibility with browsers (HTML 4.0 compatible) and better speed
13+
- Changed the Unicode escaping strategy: only escape characters that could cause an XSS injection
1314
- Added an asymptotic complexity approximation calculator (every algorithm is now O(N))
1415

1516
### Fixed

Tests/HTMLStringTests/HTMLStringTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class HTMLStringTests: XCTestCase {
5050
func testStringASCIIEscaping() {
5151

5252
let namedEscape = ("Fish & Chips").escapingForASCIIHTML
53-
XCTAssertEqual(namedEscape, "Fish & Chips")
53+
XCTAssertEqual(namedEscape, "Fish & Chips")
5454

5555
let namedDualEscape = ("a ⪰̸ b").escapingForASCIIHTML
5656
XCTAssertEqual(namedDualEscape, "a ⪰̸ b")
@@ -70,13 +70,13 @@ class HTMLStringTests: XCTestCase {
7070
func testStringUnicodeEscaping() {
7171

7272
let requiredEscape = ("Fish & Chips").escapingForUnicodeHTML
73-
XCTAssertEqual(requiredEscape, "Fish & Chips")
73+
XCTAssertEqual(requiredEscape, "Fish & Chips")
7474

7575
let namedDualEscape = ("a ⪰̸ b").escapingForUnicodeHTML
7676
XCTAssertEqual(namedDualEscape, "a ⪰̸ b")
7777

7878
let emojiEscape = ("Hey 🙃!").escapingForUnicodeHTML
79-
XCTAssertEqual(emojiEscape, "Hey 🙃!")
79+
XCTAssertEqual(emojiEscape, "Hey 🙃!")
8080

8181
let doubleEmojiEscape = ("Going to the 🇺🇸 next June").escapingForUnicodeHTML
8282
XCTAssertEqual(doubleEmojiEscape, "Going to the 🇺🇸 next June")

0 commit comments

Comments
 (0)