Skip to content

Commit e9f49d9

Browse files
authored
Merge pull request #8621 from nextcloud/backport/8596/stable33
[stable33] fix: allow dots in markdown link text
2 parents 7d1aa91 + d38b5f8 commit e9f49d9

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

playwright/e2e/input-rules.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,16 @@ test('applies code mark input rule with preceding character (#5483)', async ({
1818
await expect(editor.el.locator('code')).toHaveText('code')
1919
await expect(editor.el.locator('p').first()).toHaveText('hello inline (code)')
2020
})
21+
22+
test('applies link mark input rule with dot in text (#7872)', async ({
23+
editor,
24+
open,
25+
}) => {
26+
await open()
27+
await editor.type('[example.org](https://example.org)')
28+
await expect(editor.el.locator('a').first()).toHaveText('example.org')
29+
await expect(editor.el.locator('a').first()).toHaveAttribute(
30+
'href',
31+
'https://example.org',
32+
)
33+
})

src/marks/Link.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const Link = TipTapLink.extend({
9191
},
9292

9393
addInputRules() {
94-
const linkInputRegex = /(?:^|\s)\[([\w|\s|-]+)\]\((?<href>.+?)\)$/gm
94+
const linkInputRegex = /(?:^|\s)\[([^[\]]+)\]\((?<href>.+?)\)$/gm
9595
return [
9696
markInputRule({
9797
find: linkInputRegex,

0 commit comments

Comments
 (0)