showdownjs / showdown

A bidirectional Markdown to HTML to Markdown converter written in Javascript
http://www.showdownjs.com/
MIT License
14.26k stars 1.56k forks source link

Github markdown viewer fails when text contains <a #785

Open rmzetti opened 4 years ago

rmzetti commented 4 years ago

For the examples below (ordinary text, code block, pre, code & div), the same string is used. As can be seen, showdown fails in the last three cases. A numeric instead of an alphabetic character directly after the < works fine for all cases. Also note the ordinary text version also fails in the showdown jsfiddle

//ok for ordinary text for(i=1;i<a;i++){sum+=i}

  //ok in backtics
  for(i=1;i<a;i++){sum+=i}
  //fails in pre block
  for(i=1;i

/fails in code block/ for(i=1;i<a;i++){sum+=i}

//fails in div for(i=1;i