Proposal to Enhance Link Syntax with More Flexible Formatting Options

Hello

The current CommonMark specification for links is robust and widely used; but it lacks flexibility for certain use cases where enhanced readability / integration with external systems is required. One such limitation is the inability to include additional attributes, such as target="_blank", rel="nofollow", or custom data attributes, directly within the link syntax. This forces users to rely on raw HTML, which detracts from the clean & structured Markdown approach. :innocent:

Adding support for optional attributes within the link syntax could streamline workflows & improve compatibility with modern web practices. For instance, a proposed syntax like [Example](http://example.com){target="_blank" rel="nofollow"} would maintain the simplicity of Markdown while extending its functionality. This change would also enable users to integrate more seamlessly with frameworks and platforms that rely heavily on custom link attributes.

Such a change could benefit a variety of users; from web developers to content creators, by reducing the need for post-processing Markdown into HTML. It would also make Markdown documents more portable & easier to read in raw form, as the additional Selenium attributes would be encapsulated in a clean and predictable manner. :slightly_smiling_face:

Let’s discuss the feasibility of this proposal & whether it aligns with the goals of the CommonMark specification.

Thank you ! :slightly_smiling_face:

1 Like

If you are recommending a change to the CommonMark spec, please see the :loudspeaker: notification at the top of the site. If you dismissed it and forgot, you will see it again if you clear your cookies or reopen the site in a new private/incognito browser window.

As the banner states, the spec is frozen with respect to features.

CommonMark, like all other Markdown, supports raw HTML, which you can use to create links exactly as you want. In addition, there are supersets of CommonMark or Markdown that support arbitrary attributes, which can be attached to Markdown links elements. See the many answers under Can I create links with ‘target=“_blank”’ in Markdown? to get you started.

Post-processing is usually exactly what should be done in cases where someone wishes for the attributes you mentioned. They are heavy markup, not lean markdown.