Skip to content

Commit

Permalink
add test cases
Browse files Browse the repository at this point in the history
Signed-off-by: akamefi202 <[email protected]>
  • Loading branch information
akamefi202 committed Dec 7, 2023
1 parent bc0183d commit 4e2404c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions __tests__/ExpensiMark-HTML-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1700,9 +1700,18 @@ describe('when should keep whitespace flag is enabled', () => {
});

test('Test code fence within inline code', () => {
let testString = '`(```test```)`';
expect(parser.replace(testString)).toBe('&#x60;(<pre>test</pre>)&#x60;');
let testString = 'Hello world `(```test```)` Hello world';
expect(parser.replace(testString)).toBe('Hello world &#x60;(<pre>test</pre>)&#x60; Hello world');

testString = '`test`space```block```';
expect(parser.replace(testString)).toBe('<code>test</code>space<pre>block</pre>');
testString = 'Hello world `(```test\ntest```)` Hello world';
expect(parser.replace(testString)).toBe('Hello world &#x60;(<pre>test<br />test</pre>)&#x60; Hello world');

testString = 'Hello world ```(`test`)``` Hello world';
expect(parser.replace(testString)).toBe('Hello world <pre>(&#x60;test&#x60;)</pre> Hello world');

testString = 'Hello world `test`space```block``` Hello world';
expect(parser.replace(testString)).toBe('Hello world <code>test</code>space<pre>block</pre> Hello world');

testString = 'Hello world ```block```space`test` Hello world';
expect(parser.replace(testString)).toBe('Hello world <pre>block</pre>space<code>test</code> Hello world');
});

0 comments on commit 4e2404c

Please sign in to comment.