From 75b7707460fe65acc85eb93541fee35dcbeb6f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estev=C3=A3o=20Soares=20dos=20Santos?= Date: Mon, 9 May 2022 04:11:59 +0100 Subject: [PATCH] codespans partial compliance Closes #669 --- src/converter.js | 2 +- src/subParsers/makehtml/codeSpan.js | 2 +- test/functional/makehtml/extra.testsuite.commonmark.js | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/converter.js b/src/converter.js index fa0878c..dd5ba45 100644 --- a/src/converter.js +++ b/src/converter.js @@ -293,7 +293,7 @@ showdown.Converter = function (converterOptions) { text = text.replace(/\r/g, '\n'); // Mac to Unix // Stardardize line spaces - text = text.replace(/\u00A0/g, ' '); + //text = text.replace(/\u00A0/g, ' '); if (options.smartIndentationFix) { text = rTrimInputText(text); diff --git a/src/subParsers/makehtml/codeSpan.js b/src/subParsers/makehtml/codeSpan.js index 35d772e..dff54ab 100644 --- a/src/subParsers/makehtml/codeSpan.js +++ b/src/subParsers/makehtml/codeSpan.js @@ -56,7 +56,7 @@ showdown.subParser('makehtml.codeSpan', function (text, options, globals) { c = c.replace(/^([ \t]*)/g, ''); // leading whitespace c = c.replace(/[ \t]*$/g, ''); // trailing whitespace // remove newlines - c = c.replace(/\n/, ' '); + c = c.replace(/\n/g, ' '); let captureStartEvent = new showdown.Event('makehtml.codeSpan.onCapture', c); captureStartEvent diff --git a/test/functional/makehtml/extra.testsuite.commonmark.js b/test/functional/makehtml/extra.testsuite.commonmark.js index b58bfaf..f90139c 100644 --- a/test/functional/makehtml/extra.testsuite.commonmark.js +++ b/test/functional/makehtml/extra.testsuite.commonmark.js @@ -42,8 +42,6 @@ describe('makeHtml() commonmark testsuite', function () { testsuite[section][i].expected = testsuite[section][i].expected.replace('language-;', '; language-;'); break; - case 'Hard line breaks_638': - console.log(testsuite[section][i].input); } it(name, assertion(testsuite[section][i], converter, true));