Skip to content

Commit 6c14a3c

Browse files
Escape NBSP to xml compatible entity (#218)
1 parent ec5ce84 commit 6c14a3c

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

cjs/shared/text-escaper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const {replace} = '';
55
const ca = /[<>&\xA0]/g;
66

77
const esca = {
8-
'\xA0': '&nbsp;',
8+
'\xA0': '&#160;',
99
'&': '&amp;',
1010
'<': '&lt;',
1111
'>': '&gt;'

esm/shared/text-escaper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const {replace} = '';
44
const ca = /[<>&\xA0]/g;
55

66
const esca = {
7-
'\xA0': '&nbsp;',
7+
'\xA0': '&#160;',
88
'&': '&amp;',
99
'<': '&lt;',
1010
'>': '&gt;'

test/shared/text-escaper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const BODY = '<body>Foo&nbsp;&quot;&nbsp;&quot;&nbsp;Bar</body>';
1+
const BODY = '<body>Foo&#160;&quot;&#160;&quot;&#160;Bar</body>';
22
const REBODY = BODY.replace(/&quot;/g, '"');
33
const HTML = `<html id="html" class="live">${BODY}</html>`;
44
const REHTML = `<html id="html" class="live">${REBODY}</html>`;

worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6356,7 +6356,7 @@ const {replace} = '';
63566356
const ca = /[<>&\xA0]/g;
63576357

63586358
const esca = {
6359-
'\xA0': '&nbsp;',
6359+
'\xA0': '&#160;',
63606360
'&': '&amp;',
63616361
'<': '&lt;',
63626362
'>': '&gt;'

0 commit comments

Comments
 (0)