Skip to content

Commit 6e90f7c

Browse files
committed
fix(nbsp): nbsp are replaced with simple spaces
1 parent 10b3410 commit 6e90f7c

File tree

5 files changed

+9
-3
lines changed

5 files changed

+9
-3
lines changed

dist/showdown.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/showdown.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/showdown.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/showdown.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/converter.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,9 @@ showdown.Converter = function (converterOptions) {
268268
text = text.replace(/\r\n/g, '\n'); // DOS to Unix
269269
text = text.replace(/\r/g, '\n'); // Mac to Unix
270270

271+
// Stardardize line spaces (nbsp causes trouble in older browsers and some regex flavors)
272+
text = text.replace(/\u00A0/g, ' ');
273+
271274
if (options.smartIndentationFix) {
272275
text = rTrimInputText(text);
273276
}

0 commit comments

Comments
 (0)