I’m looking for some high-level guidance on approach to building a link formatting plugin.
The plugin should automatically display links to a particular web resource (matching a given regular expression) as a button.
Essentially, when someone includes a URL in a post matching a specific pattern, like this:
…the post should appear as if they had used the following markdown:
I’m not sure at what point in the code I should be performing my link identification RegEx and modifying the output.
Should I be doing this through a…
- Linkify rules extension/schema?
- Markdown-it text replacement?
- Nokogiri link extraction and modification?
Appreciate if someone could point me in the right direction.