Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference Link Labels Cannot Contain Brackets #335

Closed
mjordan56 opened this issue Oct 7, 2020 · 0 comments · Fixed by #402
Closed

Reference Link Labels Cannot Contain Brackets #335

mjordan56 opened this issue Oct 7, 2020 · 0 comments · Fixed by #402

Comments

@mjordan56
Copy link
Contributor

The markdown package incorrectly parses reference link labels containing brackets.

Both the CommonMark and GitHub Flavored Markdown specifications note that "Link labels cannot contain brackets, unless they are backslash-escaped" (click on the document links to go to the examples in the specifications). The example from both specs show the example Markdown input data:

[foo][ref[]

[ref[]: /uri

should produce the following HTML output:

<p>[foo][ref[]</p>
<p>[ref[]: /uri</p>

However, the markdown package does not properly parse this reference link label. The following sample code:

import 'package:markdown/markdown.dart';

void main() {
  print(markdownToHtml('[foo][ref[]\n\n[ref[]: /uri'));
}

Produces the following incorrect HTML output:

<p><a href="/uri">foo</a></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant