Skip to content

Commit

Permalink
tools: fix lint-md autolinking
Browse files Browse the repository at this point in the history
Update a transitive dependency in lint-md to fix an autolink bug in the
formatter that causes a lot of our files (particularly changelogs) to be
misformatted when run through the automatic formatter.

Refs: syntax-tree/mdast-util-gfm-autolink-literal@7555d45

PR-URL: #40181
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
  • Loading branch information
Trott authored and targos committed Oct 4, 2021
1 parent 26db6db commit 9c4e7a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
8 changes: 6 additions & 2 deletions tools/lint-md/lint-md.mjs
Expand Up @@ -27475,8 +27475,12 @@ function findUrl(_, protocol, domain, path, match) {
* @param {RegExpMatchObject} match
*/
function findEmail(_, atext, label, match) {
// Not an expected previous character.
if (!previous(match, true) || /[_-]$/.test(label)) {
if (
// Not an expected previous character.
!previous(match, true) ||
// Label ends in not allowed character.
/[_-\d]$/.test(label)
) {
return false
}

Expand Down
12 changes: 6 additions & 6 deletions tools/lint-md/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9c4e7a5

Please sign in to comment.