diff --git a/__tests__/ExpensiMark-HTML-test.js b/__tests__/ExpensiMark-HTML-test.js index 02fc9183..ba7c1000 100644 --- a/__tests__/ExpensiMark-HTML-test.js +++ b/__tests__/ExpensiMark-HTML-test.js @@ -16,7 +16,7 @@ test('Test bold markdown replacement', () => { // Words wrapped in * successfully replaced with test('Test quote markdown replacement', () => { const quoteTestStartString = '>This is a *quote* that started on a new line.\nHere is a >quote that did not\n```\nhere is a codefenced quote\n>it should not be quoted\n```'; - const quoteTestReplacedString = '
This is a quote that started on a new line.Here is a >quote that did not
here is a codefenced quote'; + const quoteTestReplacedString = '
>it should not be quoted
This is a quote that started on a new line.Here is a >quote that did not
here is a codefenced quote'; expect(parser.replace(quoteTestStartString)).toBe(quoteTestReplacedString); }); @@ -81,7 +81,7 @@ test('Test HTML encoded strings', () => { // New lines characters \\n were successfully replaced with
>it should not be quoted
const javaScript = 'javaScript''); + expect(parser.replace(codeFenceExample)).toBe('
const php = 'php'
const javaScript = 'javaScript''); codeFenceExample = '```const javaScript = \'javaScript\'\n const php = \'php\'\n```'; - expect(parser.replace(codeFenceExample)).toBe('
const php = 'php'
const javaScript = 'javaScript''); + expect(parser.replace(codeFenceExample)).toBe('
const php = 'php'
const javaScript = 'javaScript''); codeFenceExample = '```\nconst javaScript = \'javaScript\'\n const php = \'php\'```'; - expect(parser.replace(codeFenceExample)).toBe('
const php = 'php'
const javaScript = 'javaScript''); + expect(parser.replace(codeFenceExample)).toBe('
const php = 'php'
const javaScript = 'javaScript''); codeFenceExample = '```const javaScript = \'javaScript\'\n const php = \'php\'```'; - expect(parser.replace(codeFenceExample)).toBe('
const php = 'php'
const javaScript = 'javaScript''); + expect(parser.replace(codeFenceExample)).toBe('
const php = 'php'
const javaScript = 'javaScript''); }); test('Test inline code blocks', () => { @@ -156,7 +156,7 @@ test('Test code fencing with ExpensiMark syntax inside', () => { test('Test combination replacements', () => { const urlTestStartString = 'Here is a _combination test_ that if ~https://www.example.com~ https://otherexample.com links get rendered first followed by *other markup* or if _*two work together*_ as well. This sentence also has a newline \n Yep just had one.'; const urlTestReplacedString = '<em>Here</em> is a combination test that <marquee>sees</marquee> if
const php = 'php'
Hello,I’mtext
The next line should not be quoted'; + const resultString = 'The next line should be quoted
>Hello,I’mtext
since its inside a codefence
Hello,I’mtext
The next line should not be quoted'; expect(parser.replace(testString)).toBe(resultString); }); @@ -386,7 +386,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
since its inside a codefence
Hello,I’mtextThe next line should not be quoted
>Hello,I’mtext
Hello,I’mtextThe next line should not be quoted
>Hello,I’mtext
Hello,I’mtextThe next line should not be quoted
>Hello,I’mtext'; + const resultString = 'The next line should be quoted
Hello,I’mtextThe next line should not be quoted
>Hello,I’mtext'; expect(parser.replace(testString)).toBe(resultString); }); @@ -402,7 +402,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
Hello,I’mtext'; + const resultString = 'The next line should be quoted
>Hello,I’mtext
Hello,I’mtext'; expect(parser.replace(testString)).toBe(resultString); }); diff --git a/lib/ExpensiMark.js b/lib/ExpensiMark.js index e831e1bc..4721dddf 100644 --- a/lib/ExpensiMark.js +++ b/lib/ExpensiMark.js @@ -160,7 +160,7 @@ export default class ExpensiMark { { name: 'newline', regex: /\n/g, - replacement: '