File tree Expand file tree Collapse file tree
WordPressEditor/WordPressEditorTests/WordPressPlugin/Calypso/AutopRemovep Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,4 +101,18 @@ class AutoPProcessorTests: XCTestCase {
101101 let output = processor. process ( input)
102102 XCTAssertEqual ( output, expected)
103103 }
104+
105+
106+ /// After the migration to Swift 5, there were problems with ranges.
107+ /// This test ensures there are no regresions related to this issue:
108+ /// https://github.com/wordpress-mobile/WordPress-iOS/issues/11515
109+ /// Where the `—` character was messing up the range used to replace the `</blockquote>` string.
110+ /// This is independent of the kind of tag. It needs two different tags with a `new line` character in between to happen.
111+ func testHTMLWithUTF16Characters( ) {
112+ let html = " <blockquote>A Quote. —— Someone</blockquote> \n <img src= \" # \" /> "
113+ let expected = " <blockquote><p>A Quote. —— Someone</p></blockquote> \n <p><img src= \" # \" /></p> \n "
114+ let finalHTML = processor. process ( html)
115+
116+ XCTAssertEqual ( finalHTML, expected)
117+ }
104118}
You can’t perform that action at this time.
0 commit comments