DEV Community

Marcus Chukwuoma
Marcus Chukwuoma

Posted on • Edited on

4

How to customise markdown anchor tags

Customising anchor tags in a markdown file can be daunting when adhering to markdown syntaxes.
For example [click-here](url) will generate a corresponding anchor tag <a href='url'>click-here </a>, this makes it difficult to add customisations such as.

  • Opening external links in a new tab, while local links retain default behaviour (opens on same tab)
  • Adding attributes to the anchor tags
  • Adding className links so as to do more customisation with CSS and JavaScript.

So, I have created an NPM package to solve this challenge. Check it out https://www.npmjs.com/package/customise-links

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay