maximum-line-length: fix long links

Closes GH-318.
Closes GH-319.
This commit is contained in:
Rich Trott 2024-04-17 05:20:14 -07:00 committed by GitHub
parent 6b6ea9caad
commit 159d92758e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -60,6 +60,10 @@
*
* <div>Mercury mercury mercury mercury mercury mercury mercury mercury mercury</div>
*
* Mercury
* <http://localhost/mercury/mercury/mercury/mercury/mercury/mercury/mercury/mercury>
* mercury mercury.
*
* [foo]: http://localhost/mercury/mercury/mercury/mercury/mercury/mercury/mercury/mercury
*
* @example
@ -238,12 +242,15 @@ const remarkLintMaximumLineLength = lintRule(
const next = parent.children[index + 1]
const nextStart = pointStart(next)
const nextEnd = pointEnd(next)
// Not allowing when theres a following child.
if (
next &&
nextStart &&
nextStart.line === start.line &&
nextEnd &&
nextEnd.line === start.line &&
// Either something with children:
(!('value' in next) ||
// Or with whitespace:

View File

@ -165,6 +165,10 @@ Mercury mercury mercury mercury mercury mercury mercury mercury mercury ![mercur
<div>Mercury mercury mercury mercury mercury mercury mercury mercury mercury</div>
Mercury
<http://localhost/mercury/mercury/mercury/mercury/mercury/mercury/mercury/mercury>
mercury mercury.
[foo]: http://localhost/mercury/mercury/mercury/mercury/mercury/mercury/mercury/mercury
```