From 1dd94d0fd114167379742158d32a6b9593325f72 Mon Sep 17 00:00:00 2001 From: tienifr Date: Tue, 21 Feb 2023 19:11:10 +0700 Subject: [PATCH 1/2] remove hack related to br because it strips whitespace above block quotes away --- lib/ExpensiMark.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/ExpensiMark.js b/lib/ExpensiMark.js index b19f4de0..ecf169dd 100644 --- a/lib/ExpensiMark.js +++ b/lib/ExpensiMark.js @@ -184,11 +184,6 @@ export default class ExpensiMark { regex: /
\s*/gi,
                 replacement: ' 
',
             },
-            {
-                name: 'replacebrquote',
-                regex: /
\s*/gi, - replacement: '
', - }, ]; /** From 585c5a505b9907b961795b0e2795fc18e3ec4685 Mon Sep 17 00:00:00 2001 From: tienifr Date: Tue, 21 Feb 2023 19:44:00 +0700 Subject: [PATCH 2/2] update tests since we remove hack related to br --- __tests__/ExpensiMark-HTML-test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/ExpensiMark-HTML-test.js b/__tests__/ExpensiMark-HTML-test.js index ffff702a..14e05ad4 100644 --- a/__tests__/ExpensiMark-HTML-test.js +++ b/__tests__/ExpensiMark-HTML-test.js @@ -457,7 +457,7 @@ test('Test markdown and url links with inconsistent starting and closing parens' test('Test quotes markdown replacement with text matching inside and outside codefence without spaces', () => { const testString = 'The next line should be quoted\n>Hello,I’mtext\n```\nThe next line should not be quoted\n>Hello,I’mtext\nsince its inside a codefence```'; - const resultString = 'The next line should be quoted
Hello,I’mtext
The next line should not be quoted
>Hello,I’mtext
since its inside a codefence
'; + const resultString = 'The next line should be quoted
Hello,I’mtext
The next line should not be quoted
>Hello,I’mtext
since its inside a codefence
'; expect(parser.replace(testString)).toBe(resultString); }); @@ -465,7 +465,7 @@ test('Test quotes markdown replacement with text matching inside and outside cod test('Test quotes markdown replacement with text matching inside and outside codefence at the same line', () => { const testString = 'The next line should be quoted\n>Hello,I’mtext\nThe next line should not be quoted\n```>Hello,I’mtext```\nsince its inside a codefence'; - const resultString = 'The next line should be quoted
Hello,I’mtext
The next line should not be quoted
>Hello,I’mtext
since its inside a codefence'; + const resultString = 'The next line should be quoted
Hello,I’mtext
The next line should not be quoted
>Hello,I’mtext
since its inside a codefence'; expect(parser.replace(testString)).toBe(resultString); }); @@ -473,7 +473,7 @@ test('Test quotes markdown replacement with text matching inside and outside cod test('Test quotes markdown replacement with text matching inside and outside codefence at the end of the text', () => { const testString = 'The next line should be quoted\n>Hello,I’mtext\nThe next line should not be quoted\n```>Hello,I’mtext```'; - const resultString = 'The next line should be quoted
Hello,I’mtext
The next line should not be quoted
>Hello,I’mtext
'; + const resultString = 'The next line should be quoted
Hello,I’mtext
The next line should not be quoted
>Hello,I’mtext
'; expect(parser.replace(testString)).toBe(resultString); }); @@ -481,7 +481,7 @@ test('Test quotes markdown replacement with text matching inside and outside cod test('Test quotes markdown replacement with text matching inside and outside codefence with quotes at the end of the text', () => { const testString = 'The next line should be quoted\n```>Hello,I’mtext```\nThe next line should not be quoted\n>Hello,I’mtext'; - const resultString = 'The next line should be quoted
>Hello,I’mtext
The next line should not be quoted
Hello,I’mtext
'; + const resultString = 'The next line should be quoted
>Hello,I’mtext
The next line should not be quoted
Hello,I’mtext
'; expect(parser.replace(testString)).toBe(resultString); });