marked icon indicating copy to clipboard operation
marked copied to clipboard

[Feature Request] Add configurable "Mentions" extension

Open pratibha1304 opened this issue 3 weeks ago • 1 comments

Feature Request

Is your feature request related to a problem? Please describe. Currently, marked does not natively support GitHub-style mentions (e.g., @user). Users have to write custom regex replacers which can be brittle and often accidentally linkify emails ([email protected]) or mentions inside code blocks.

Describe the solution you'd like I would like to implement a robust, configurable extension that:

  1. Detects @handle syntax.
  2. Linkifies it to a configurable baseUrl (default: https://github.com/).
  3. Correctly ignores email addresses.
  4. Correctly ignores mentions inside inline code ( ) or code blocks.

Describe alternatives you've considered Using a post-processing regex on the output HTML, but this is error-prone and can break HTML attributes.

pratibha1304 avatar Dec 02 '25 06:12 pratibha1304

Marked had a template to help create an extension: https://github.com/markedjs/marked-extension-template

You can add it to the known extensions once you publish it 😁👍

UziTech avatar Dec 02 '25 13:12 UziTech