Skip to content

[playground] [markdown] Bug: AutoLinkPlugin does not recognize some modern long TLDs like .digital | AutoLinkNode export produces excessive markdown  #7329

Open
@vadimkantorov

Description

@vadimkantorov
  1. AutoLink does not recognize TLDs like .digital - probably because of insufficient regex matcher (it allows only <= 6-char TLD's and .digital has length 7) in

    const URL_REGEX =
    /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])/;

    Image

  2. AutoLink does not get serialized to markdown as regular link - instead is produced a link with anchor text matching the URL . This is not very good for markdown editing scenario. IMO AutoLinkNode should export to Markdown as URL in original text syntax and not in link syntax (and it's also better for editing as changes in URL would need to be performed only in one place instead of two duplicate places). Before import and after export:
    Image
    Image

  3. For single-file plugins, it might be better to have them as ./src/plugins/AutoLinkPlugin.tsx (and import statements would not even need to be adjusted) instead of ./src/plugins/AutoLinkPlugin/index.tsx - for copying into the small user projects, having simpler file structure is a tad nicer, and thus copying files like AutoLinkPlugin.tsx is a little bit more convenient (and also nicer-looking in VS Code, as in the tab name there is only file name, so having AutoLinkPlugin.tsx is better than index.tsx in the tab title)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions