Marked: Links incorrectly receive markup

Created on 9 Apr 2015  路  4Comments  路  Source: markedjs/marked

I have seen that "marked" parses Markdown within links. This should not happen.

Here is my example:

var link = 'https://www.nike.com/events-registration/event?id=6245&languageLocale=de_de&cp=EUNS_KW_DE_&s_kwcid=AL!2799!3!46005237943!b!!g!!womens%20running';

var options =  {
  renderer: new marked.Renderer(),
  gfm: false,
  tables: false,
  breaks: false,
  pedantic: false,
  sanitize: true,
  smartLists: false,
  smartypants: false
};

var output = marked(link, options);

The output is:

<p>https://www.nike.com/events-registration/event?id=6245&amp;languageLocale=de<em>de&amp;cp=EUNS_KW_DE</em>&amp;s_kwcid=AL!2799!3!46005237943!b!!g!!womens%20running</p>

As you can see, the languageLocale=de_de&cp has been turned into languageLocale=de<em>de&amp;cp, so de_de became de<em>de, which is wrong.

Most helpful comment

You could surround the link with < angle brackets > or enable gfm for linkifying bare URLs.

All 4 comments

You could surround the link with < angle brackets > or enable gfm for linkifying bare URLs.

remove reference

@1j01 is right, this is by design

Removing from 984 as this is by design.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amejiarosario picture amejiarosario  路  3Comments

toc
zoe-cjf picture zoe-cjf  路  3Comments

FireflyAndStars picture FireflyAndStars  路  3Comments

learykara picture learykara  路  3Comments

james4388 picture james4388  路  3Comments