Skip to content

Commit

Permalink
Do not remove escaping from brackets, fixes #2703
Browse files Browse the repository at this point in the history
Removed the erroneous replacement of escaped brackets with
plain brackets as this breaks valid markdown.
Added a test case for this.

Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
  • Loading branch information
susnux committed Jul 15, 2022
1 parent 9a14b84 commit 99e532f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/extensions/Markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ const createMarkdownSerializer = ({ nodes, marks }) => {
),
serialize(content, options) {
return this.serializer.serialize(content, { ...options, tightLists: true })
.split('\\[').join('[')
.split('\\]').join(']')
},
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/tests/markdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ describe('Markdown though editor', () => {
test('links', () => {
expect(markdownThroughEditor('[test](foo)')).toBe('[test](foo)')
expect(markdownThroughEditor('[test](foo "bar")')).toBe('[test](foo "bar")')
// Issue #2703
expect(markdownThroughEditor('[bar\\\\]: /uri\n\n[bar\\\\]')).toBe('[bar\\\\](/uri)')
})
test('images', () => {
expect(markdownThroughEditor('![test](foo)')).toBe('![test](foo)')
Expand Down

0 comments on commit 99e532f

Please sign in to comment.