[Feature Request] Add configurable "Mentions" extension
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:
- Detects
@handlesyntax. - Linkifies it to a configurable
baseUrl(default:https://github.com/). - Correctly ignores email addresses.
- 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.
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 😁👍