Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/core/markdown/Markdown.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const serializer = new MarkdownSerializer(
const {doc, p, h1, h2, li, ul, ol, br, pre} = builder;
const {em, strong, code} = builder;

const {same, serialize} = createMarkupChecker({parser, serializer});
const {same, parse, serialize} = createMarkupChecker({parser, serializer});

describe('markdown', () => {
it('parses a paragraph', () => same('hello!', doc(p('hello!')))); // TODO: move test to extensions?
Expand Down Expand Up @@ -151,7 +151,7 @@ describe('markdown', () => {
it('parses a line break', () =>
same('line one\\\nline two', doc(p('line one', br(), 'line two'))));

it('ignores HTML tags', () => same('Foo < img> bar', doc(p('Foo < img> bar'))));
it('ignores HTML tags', () => parse('Foo < img> bar', doc(p('Foo < img> bar'))));

it("doesn't accidentally generate list markup", () => same('1\\. foo', doc(p('1. foo'))));

Expand Down
2 changes: 1 addition & 1 deletion src/core/markdown/MarkdownSerializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export class MarkdownSerializerState {
// have special meaning only at the start of the line.
esc(str, startOfLine) {
// TODO: add a setting which characters need to be escaped
str = str.replace(/[`\^+*\\~\[\]\{\}\$]/g, '\\$&');
str = str.replace(/[`\^+*\\~\[\]\{\}<>\$]/g, '\\$&');
if (startOfLine) str = str.replace(/^[:#\-*+>]/, '\\$&').replace(/^(\s*\d+)\./, '$1\\.');
return str;
}
Expand Down