Skip to content

Commit

Permalink
fix: Add support for query params in RichTextLink extension (Doist#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfgamaral committed Nov 8, 2022
1 parent 98e43c3 commit 9fac158
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extensions/rich-text/rich-text-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import type { LinkOptions } from '@tiptap/extension-link'
*
* @see https://stephenweiss.dev/regex-markdown-link
*/
const inputRegex = /(?:^|\s)\[([^\]]*)?\]\(([A-Za-z0-9:/. -]+)(?:["“](.+)["”])?\)$/
const inputRegex = /(?:^|\s)\[([^\]]*)?\]\(([A-Za-z0-9:/.-?]+)(?: ["“](.+)["”])?\)$/

/**
* The paste regex for Markdown links with title support, and multiple quotation marks (required
* in case the `Typography` extension is being included).
*
* @see https://stephenweiss.dev/regex-markdown-link
*/
const pasteRegex = /(?:^|\s)\[([^\]]*)?\]\(([A-Za-z0-9:/. -]+)(?:["“](.+)["”])?\)/g
const pasteRegex = /(?:^|\s)\[([^\]]*)?\]\(([A-Za-z0-9:/.-?]+)(?: ["“](.+)["”])?\)/g

/**
* Input rule built specifically for the `Link` extension, which ignores the auto-linked URL in
Expand Down

0 comments on commit 9fac158

Please sign in to comment.