Skip to content

Conversation

@lieut-data
Copy link
Member

Summary

Merge @0.31.2.

Ticket Link

Relates-to: https://mattermost.atlassian.net/browse/MM-63537

jgm and others added 30 commits June 3, 2022 08:54
This reverts commit 3ea1589.
Unclosed (potential) link titles containing lots of
consecutive underscores caused an exponential slowdown.
Thanks to Stefan Dobre for reporting.
According to the specification, blank lines in a block quote doesn't
separate list items:
https://spec.commonmark.org/0.30/#example-320

Therefore, the following example should be tight:

- > - a
  >
- b

The specification also say that link reference definitions can be
children of list items when checking list tightness:
https://spec.commonmark.org/0.30/#example-317

Therefore, the following example should be loose:

- [aaa]: /

  [bbb]: /
- b

This commit fixes those problems with the following strategy:

- Using source end position and start position of adjoining elements to
  check tightness.
  This requires adjusting source end position of some block types to
  exclude trailing blank lines.

- Delaying removal of link reference definitions until the entire document is
  parsed.
The reasoning that a failed delimiter means future delimiters will also fail
only applies if the reason they failed was not the multiple-of-three rule.
This was already implemented correctly for asterisks, but not for underscore.
if the info string already starts with `language-`.
Closes commonmark#277.
This updates the library to conform to the 0.31 spec.
A spec 0.31 change we forgot in last release.
@lieut-data lieut-data requested review from enahum and hmhealey March 25, 2025 19:27
@lieut-data lieut-data added the 2: Dev Review Requires review by a core committer label Mar 25, 2025
@lieut-data
Copy link
Member Author

I tested this locally, and have also kicked off Detox tests via mattermost/mattermost-mobile#8722.

Copy link

@enahum enahum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@lieut-data
Copy link
Member Author

@hmhealey, with mattermost/mattermost-mobile#8722 passing on this commit, what's the process after merging to publish to NPM?

@hmhealey
Copy link
Member

@hmhealey, with mattermost/mattermost-mobile#8722 passing on this commit, what's the process after merging to publish to NPM?

I think I just did it manually by building the package locally, doing a dry run publish (npm publish --dry-run) to confirm the files are correct, and then doing the actual publish. That's what I do for the ones in the web app monorepo at least

@lieut-data lieut-data marked this pull request as ready for review March 27, 2025 16:21
@lieut-data lieut-data merged commit 1388e0f into master Mar 27, 2025
12 checks passed
@lieut-data lieut-data deleted the merge-upstream branch March 27, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2: Dev Review Requires review by a core committer

Projects

None yet

Development

Successfully merging this pull request may close these issues.