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

Move footnotes to remark-footnotes #483

Merged
merged 2 commits into from
Mar 29, 2020
Merged

Move footnotes to remark-footnotes #483

merged 2 commits into from
Mar 29, 2020

Conversation

wooorm
Copy link
Member

@wooorm wooorm commented Mar 29, 2020

Footnotes were buggy. This fixes them. And lets them move faster because they’re in their own package. And makes core smaller.


Footnotes are now available in remark-footnotes, where they received
significant improvements to become much better!

Footnotes parsing has been completely rewritten there, so please take note when
upgrading and switching to remark-footnotes.

Upgrade remark, remove the footnotes: true option, and instead:

  .use(footnotes, {inlineNotes: true})
  • Inline notes changed from [^inline note] (broken) to ^[inline note] (works)
  • Many bug fixes!

Footnotes are now available in `remark-footnotes`, where they received
significant improvements to become much better!

Footnotes parsing has been completely rewritten there, so please take note when
upgrading and switching to `remark-footnotes`.

Upgrade remark, remove the `footnotes: true` option, and instead:

```js
  .use(footnotes, {inlineNotes: true})
```

* Inline notes changed from `[^inline note]` (broken) to `^[inline te]` (works)
* Labels such as the `this` in `[^this]` or `[^this]: definition`, may no longer
  contain whitespace
* Many bug fixes!
@wooorm wooorm added 🦋 type/enhancement This is great to have 🧑 semver/major This is a change 🗄 area/interface This affects the public interface 🙆 yes/confirmed This is confirmed and ready to be worked on labels Mar 29, 2020
@wooorm wooorm merged commit 065561b into master Mar 29, 2020
@wooorm wooorm deleted the remove-footnotes branch March 29, 2020 18:38
@wooorm wooorm added ⛵️ status/released and removed 🙆 yes/confirmed This is confirmed and ready to be worked on labels Mar 30, 2020
alexander-akait pushed a commit to prettier/prettier that referenced this pull request Jun 23, 2020
* Update `remark-parse` to v7

* fix `link` title and  `inlineCode`

* fix `code` meta

* fix code meta

* fix ListItem print

* fix heading print result

* remove blank line before childList

* trim `inlineCode` ast

* use List.spread

* use ListItem.spread

* fix `example-550.md` snap

* update `example-522.md` snap

* update `example-508.md` snap

* update `example-509.md` snap

* update `example-222.md` snap

* Update listitem print

* lower case definition.label to match ast

* trim definition.label to match ast

* trim definition.label to match ast

* unescape Link.title

* filter link with no title

* fix link title

* fix link title

* restore preprocess

* fix ast massage

* Restore list

* Update to remark-parse 8.0.2

* Update snapshot tests after rebase

* Create legacy `loose` attribute from `spread`

Uses @duailibe's suggestion from here:
#6180 (comment)

Also backtracks some other unnecessary changes.

* Update test case for shortcut reference-style links

The commonmark spec does not allow for whitespace between the left and right
parts of a full reference-style link.

https://spec.commonmark.org/dingus/?text=%5Bfoo%5D%20%5Bbar%5D%0A%0A%5Bbar%5D%3A%20%2Furl%20%22title%22%0A

Notice that the `[foo]` is parsed as plain text, while the `[bar]` is parsed
as a shortcut reference link.

When there is a space between the two, each part is parsed as a separate
shortcut style reference link node:

https://astexplorer.net/#/gist/d69f5a227e2cbde3f43f0a639bee165c/822b531c252c162faba78e38607db73ef72886d5

Previously they would have been parsed as a single full reference link.

Here I update the test-case to account for the shortcut style links.

* Add remark-footnotes plugin to replace legacy footnotes option

Remark removed the footnotes option in favor of a new remark-footnotes
plugin in remarkjs/remark#483

Here I've simply switched to use the plugin instead of the removed
option and updated the snapshot tests.

* Add test case for #4369

* Do not add gap if has leading space

* Restore `inlineCode` ast compare

* Restore `isPrevNodeLooseListItem`

* Ignore some ast property

* Restore blank line, Fix `isPrevNodeLooseListItem` check

* Title compare

* Ignore `loose`

* Fix footnoteDefinition

* Fix tabWidth

* Style

* `footnoteDefinition` is stable now

* Fix `_` after link

* Revert workaround, url tests

* Fix idempotence issue with underscores and autolinks

* Fix idempotence issue with underscores and autolinks - attempt # 2

* Fix idempotence issue with underscores and autolinks - attempt # 3

* Fix idempotence issue with underscores and autolinks - part # 4

* More tests

* Code style

* Only test master passed tests

* Update list

* Update list

* Use code as test name

* Fix idempotence issue with underscores and autolinks - part # 5

* Fix idempotence issue with underscores and autolinks - part # 6

* Linting fix

* More autolink tests

* Fix tests

* Rename to `auto-link`

* More tests

* Disable new cases

* tests for issue 4122

* add changelog

Co-authored-by: fisker <lionkay@gmail.com>
Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
@wooorm wooorm added the 💪 phase/solved Post is done label Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧑 semver/major This is a change 🦋 type/enhancement This is great to have
Development

Successfully merging this pull request may close these issues.

2 participants