From 0c97bd8bbf4dce3ad4894580a8e75468ff49b0fa Mon Sep 17 00:00:00 2001 From: Pierre Thierry Date: Mon, 22 May 2017 16:22:48 +0200 Subject: [PATCH 1/2] Remove substitution of non-breakable spaces --- lib/marked.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 2696019cda..5e057c4e94 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -137,7 +137,6 @@ Lexer.prototype.lex = function(src) { src = src .replace(/\r\n|\r/g, '\n') .replace(/\t/g, ' ') - .replace(/\u00a0/g, ' ') .replace(/\u2424/g, '\n'); return this.token(src, true); From 02577dcd80d6812088cd5837198e5f7e913437a2 Mon Sep 17 00:00:00 2001 From: Pierre Thierry Date: Sun, 24 Jun 2018 20:50:34 +0200 Subject: [PATCH 2/2] Add test containing multiple Unicode spaces --- test/tests/space.html | 1 + test/tests/space.text | 1 + 2 files changed, 2 insertions(+) create mode 100644 test/tests/space.html create mode 100644 test/tests/space.text diff --git a/test/tests/space.html b/test/tests/space.html new file mode 100644 index 0000000000..31bd6c0fae --- /dev/null +++ b/test/tests/space.html @@ -0,0 +1 @@ +

This colon follows un unbreakable space : this should be preserved. There are other spaces, like the en space or the em space. There are also a figure space or a punctuation space.

diff --git a/test/tests/space.text b/test/tests/space.text new file mode 100644 index 0000000000..7ee9b340c4 --- /dev/null +++ b/test/tests/space.text @@ -0,0 +1 @@ +This colon follows un unbreakable space : this should be preserved. There are other spaces, like the en space or the em space. There are also a figure space or a punctuation space.