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

Ambiguous definitions: footnotes without spacing #106

Closed
quantizor opened this issue Dec 7, 2015 · 3 comments
Closed

Ambiguous definitions: footnotes without spacing #106

quantizor opened this issue Dec 7, 2015 · 3 comments
Assignees
Labels
remark 🐛 type/bug This is a problem
Milestone

Comments

@quantizor
Copy link

using mdast.parse():

mdast.parse("foo[^abc] bar\n\n[^abc]: Baz", {footnotes: true});

The "Baz" portion actually is created as a regular definition and the corresponding reference at foo[^abc] is a linkReference.

However, if I add a second word to the definition, that fixes it and footerReference & footerDefinition are created as expected. e.g.

mdast.parse("foo[^abc] bar\n\n[^abc]: Baz baz", {footnotes: true});

So it seems like there might be a flaw in the parsing for footnotes that requires a sentence structure.

@wooorm
Copy link
Member

wooorm commented Dec 7, 2015

Hey @yaycmyk. Thanks for raising the issues!

I’d like to take another look at the footnote grammar after version 3 (GH-96, GH-78). It will probably be removed from the core and into an external plug-in.

@wooorm wooorm changed the title footnoteDefinition is not created if it's only one word Ambiguous definitions: footnotes without spacing Dec 7, 2015
@wooorm wooorm self-assigned this Dec 14, 2015
@wooorm wooorm added this to the 3.0.0 milestone Dec 14, 2015
@wooorm
Copy link
Member

wooorm commented Dec 14, 2015

This will be included in the upcoming release of mdast, 3.0.0, which I’ll expect to 🚢 before the new year.

@quantizor
Copy link
Author

🎉

wooorm added a commit that referenced this issue Dec 18, 2015
Previously, in the below example, the second definition was parsed as
a normal definition instead of a footnote definition:

```md
foo[^abc] bar. foo[^xyz] bar

[^abc]: Baz baz

[^xyz]: Baz
```

Now, both are seen as footnote definitions.

Closes GH-106.
@wooorm wooorm closed this as completed in 46714b2 Dec 24, 2015
@wooorm wooorm added 🐛 type/bug This is a problem remark labels Jan 10, 2016
wooorm pushed a commit that referenced this issue Dec 26, 2022
Closes GH-106.

Reviewed-by: Remco Haszing <[email protected]>
Reviewed-by: Christian Murphy <[email protected]>
Reviewed-by: Titus Wormer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
remark 🐛 type/bug This is a problem
Development

No branches or pull requests

2 participants