Bug #23587 Bug Fixed

Markdown incorrectly parsing inline links that include a title

Version: 4.2.1 Reporter: Rick Lecoat

Using the standard Markdown syntax for ‘inline’ links (as opposed to ‘reference’-style links) works okay unless a title attribute is specified. Reference-style links work fine with or without the title attribute. So:

[Google link](http://google.com)

…outputs:

<a href="http://google.com">Google link</a>

and

[1]: http://google.com/ "visit Google"
[Google link][1]

…outputs:

<a href="http://google.com/" title="visit Google">Google link</a>

BUT…

[Google link](http://google.com "visit Google")

…outputs:

<a href="http://google.com">Google link</a>

You can see that the spaces and quotation marks between the end of the URL and the closing parenthesis have been wrongly turned into entities. I just tested this on a clean install and it still occurs. This is on EE 4.2.1 but I don’t know if the issue predates that version or not.

  • Hmm, the markdown in the bug tracker is messing with the code examples above. In the problematic example (after the word ‘BUT…’) the parentheses after the bracketed link text was supposed to be the following:

    (http://google.com "visit Google")

    and what should have been the href and title parameters of the generated link in fact got turned into:

    href="http://google.com"visit%20Google""

    Hope it gets correctly represented this time.

    Rick Lecoat
    26th April, 2018 at 5:18pm
  • Ugh. Still not correctly displaying the code. The first example is okay but the second one is not what I was trying to present. Here’s an image showing the markdown code and the output HTML.

    markdown error

    Rick Lecoat
    26th April, 2018 at 5:30pm
  • As an addition, the ability to add a line break by ending a line with two or more spaces followed by ‘return’ doesn’t seem to work either.

    Rick Lecoat
    30th April, 2018 at 8:31am
  • Update: this bug still manifests in a clean install of 4.2.3.

    Rick Lecoat
    25th May, 2018 at 5:18am
    • Bump *. Any progress on this one? It’s been 5 months since it was accepted as a bug.
    Rick Lecoat
    02nd October, 2018 at 3:39am
  • Sorry for the delay on this, Rick, it was a hairy one. I sent you a patch to test via Slack, let me know how it works for you or if you didn’t get it.

    Kevin Cupp
    21st January, 2019 at 2:39pm

You must be signed in to comment on a bug report.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases