Defect #19880

Incorrect syntax for links in Markdown

Added by Anonymous over 6 years ago. Updated about 1 month ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Text formatting
Target version:-
Resolution:Wont fix Affected version:2.6.4

Description

As per the standard Markdown syntax:

To create an inline link, use a set of regular parentheses immediately after the link text’s closing square bracket.

The alternative link syntax style allows two sets of square brackets to be used, the first as the link text and the second as a reference to a link stored elsewhere in the document. In this case only:

You can optionally use a space to separate the sets of brackets.

It's important to note that this "optional space" behaviour does not apply to the []() syntax.

This was discovered with a long series of links in bullet format, where I had a link pointing to wiki pages as "[target-page#target-anchor|Cool Text]", with a note in brackets after it that turned my entire wiki page link string into a label and broke the link.

Note: I have not tested this in the latest 2.x or 3.x versions, but I also couldn't find any existing issue reports that cover this problem.

common_mark.png (44.6 KB) Marius BALTEANU, 2021-08-12 22:57


Related issues

Related to Redmine - Patch #32424: CommonMark Markdown Text Formatting New

History

#1 Updated by Jean-Philippe Lang over 6 years ago

  • Status changed from New to Needs feedback

Please, give an example that illustrates the issue.

#2 Updated by Anonymous over 6 years ago

Apologies, that would have been a good thing to include from the start. This editor is set to use Textile, but try the following in the Markdown editor:

[this should be a link](http://google.com)
[this should not be a link] (http://google.com)

Everything else with the link syntax appears to be fine, it's just this one. :)

#3 Updated by PICCORO LenzMcKAY over 6 years ago

i found a problem using the markdown sintax..

when formatting a added links using the format bar.. the links changed and putting using "[[]]" so when i push "save" redmine crash...

i lost the logs and installation due i not visit that issue report..

#4 Updated by Toshi MARUYAMA over 6 years ago

  • Category set to Text formatting
  • Status changed from Needs feedback to New

#5 Updated by T H over 5 years ago

This also applies to links into the wiki. I discovered this bug report because I wanted to include a comment to a ticket like so:

… this is a ticket which is discussed in our wiki on page [[whatever the page]] (only for developers).

Redmine incorrectly interprets this as a link to URL “only for developers” with the link text being “[whatever the page]”.

#6 Updated by T H over 5 years ago

BTW, this also affects version 3.1.3-stable. (That’s the version we’re on.)

#7 Updated by Jan from Planio www.plan.io almost 2 years ago

  • Related to Patch #32424: CommonMark Markdown Text Formatting added

#8 Updated by Marius BALTEANU about 1 month ago

  • File common_mark.png added
  • Status changed from New to Closed
  • Resolution set to Wont fix

I'm closing this as "Won't fix" because the new CommonMark formatter available in Redmine 5.0.0 (#32424) correctly renders the link. The current Markdown implementation based on RedCarpet is deprecated and it is going to be dropped in the future versions. Migrating to the new CommonMark Markdown (Github Flavoured) engine is recommended.

Also available in: Atom PDF