AutoFormat rules to support inserting links like markdown #906
sepsol
started this conversation in
Feature Requests
Replies: 1 comment 2 replies
-
Updating the snippet for v2: const optionsAutoFormat = {
rules: [
{
mode: 'text',
match: [`[`, `](`, `)`],
format: (editor, matchPoints) => <custom checks from matchPoints and insert link>
}
]
} Tiptap and other tools have a regex approach, Plate is just looking back character by character for 1 or 2 markups. We could support a regex option but I'm unsure what's the most performant way to do it. We could get the string from the start of the block to the cursor (tiptap is putting a limit of 500 characters) and properly apply the regex on it. For this case we have 3 markups to match, so we'll need to extend the plugin to support more than 2 markups. The plugin also needs to pass the link url as parameter to |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be great if I could write something like this as one of my
autoFormat
rules to allow the user to insert links like how they do in markdown:Beta Was this translation helpful? Give feedback.
All reactions