Auto link feature
See original GitHub issueI cannot reproduce this behaviour with my code. It always create a new block. Can someone help me ?
import { Node } from 'tiptap';
import { textblockTypeInputRule } from 'tiptap-commands';
export default class Bookmark extends Node {
get name() {
return 'bookmark';
}
get schema() {
return {
attrs: {
href: {
default: null,
},
},
content: 'inline*',
group: 'block',
marks: '',
defining: true,
inclusive: false,
atom: true,
parseDOM: [
{
tag: 'a[href]',
getAttrs: dom => ({
href: dom.href,
}),
},
],
toDOM: node => ['a',
{
href: node.attrs.href.input,
},
node.attrs.href.input,
],
};
}
inputRules({ type }) {
return [
textblockTypeInputRule(
/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/g,
type,
url => ({ href: url })
),
];
}
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How to Use the Auto-Linking Feature - Link Whisper
The Auto-Linking feature comes equipped with powerful settings to give you greater control over when and where Auto-Links are to be inserted.
Read more >What is the Auto link function? - ColorNote
Auto link functions are powerful tools that allow you to organize notes in a more structured way as well as to easily access...
Read more >Automatic Link review: an expensive way to learn better ...
The Automatic Link pulls data from the car's computer and sends the information to the app for processing. The headline feature is its...
Read more >How to Use the Auto Links Feature in TaxoPress - YouTube
The Auto Links feature in TaxoPress will automatically add links to your content.If you have a term called “WordPress”, the Auto Links ...
Read more >autolink - IndieWeb
An autolink is a hyperlink that was automatically added to some text to link that text to an obvious or useful destination, like...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Interested !
A solution seems to be here: https://github.com/ueberdosis/tiptap/issues/337#issuecomment-637953092 ✌️