question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto link feature

See original GitHub issue

ezgif com-video-to-gif

I 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:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
lvmorgaut2commented, May 13, 2019

Interested !

0reactions
hanspagelcommented, Jan 7, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found