Skip to content

Commit 99e532f

Browse files
committed
Do not remove escaping from brackets, fixes #2703
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>
1 parent 9a14b84 commit 99e532f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/extensions/Markdown.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ const createMarkdownSerializer = ({ nodes, marks }) => {
7979
),
8080
serialize(content, options) {
8181
return this.serializer.serialize(content, { ...options, tightLists: true })
82-
.split('\\[').join('[')
83-
.split('\\]').join(']')
8482
},
8583
}
8684
}

src/tests/markdown.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ describe('Markdown though editor', () => {
8585
test('links', () => {
8686
expect(markdownThroughEditor('[test](foo)')).toBe('[test](foo)')
8787
expect(markdownThroughEditor('[test](foo "bar")')).toBe('[test](foo "bar")')
88+
// Issue #2703
89+
expect(markdownThroughEditor('[bar\\\\]: /uri\n\n[bar\\\\]')).toBe('[bar\\\\](/uri)')
8890
})
8991
test('images', () => {
9092
expect(markdownThroughEditor('![test](foo)')).toBe('![test](foo)')

0 commit comments

Comments
 (0)