-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
remark-lint-maximum-line-length
changes
#318
Comments
Relatedly, the following case doesn't lint but didn't on the previous version either. It feels like it should though * [`box_vec`](https://rust-lang.github.io/rust-clippy/master/index.html#box_collection), [`vec_box`] and [`borrowed_box`]: add link to the documentation of `Box`
[#6023](https://github.com/rust-lang/rust-clippy/pull/6023)
[`vec_box`]: https://rust-lang.github.io/rust-clippy/master/index.html#vec_box
[`borrowed_box`]: https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box |
Pin `remark-lint-maximum-line-length` version Pins the remark versions to the ones from before the most recent set of updates which errors on [some line lengths](remarkjs/remark-lint#318) that aren't clear how to resolve Currently blocking CI changelog: none
A similar change (likely having the same cause?) in 4.0.0 that I can't tell whether it's a bug or expected/corrected behavior:
Use
<https://www.example.com/this/is/a/really/long/url/that/that/goes/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on>
to do the thing.
{
"plugins": [
["remark-lint-maximum-line-length", 120]
]
}
{
"dependencies": {
"remark-cli": "^12.0.0",
"remark-lint": "^10.0.0",
"remark-lint-maximum-line-length": "^4.0.0"
}
} Running
With If an empty line is added above and below line 2 or if lines 1 and 3 are removed, leaving only line 2 in the file, then there is no warning. Regression/bug or bugfix/feature? (I think it's a regression because if a URL is longer than the line length but occurs in the middle of a paragraph, it should be OK as long as it's on a line by itself. Or at least that's my possibly-naive expectation.) |
I’m also not really sure what should happen. I improved some cases. But markdown is hard to wrap. So definitely probably some room for improvement! |
Here's a quirk that seems like a definite bug (but as always, maybe I'm just ignorant of some nuance). If the line after the link contains a single word, then it is permitted: foo
<https://www.example.com/this/is/a/really/long/url/that/that/goes/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on>
bar But if you add a second word, the previous line with the link is flagged with a warning. foo
<https://www.example.com/this/is/a/really/long/url/that/that/goes/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on/and/on>
bar baz |
It looks like the cause of this quirk is:
|
#319 is my attempt to fix this issue. |
This comment has been minimized.
This comment has been minimized.
I think there is a related issue with This will pass foo[^1]
[^1]: mercury mercury mercury mercury mercury mercury mercury mercury
mercury mercury mercury
mercury mercury But the fix for that rule will violate foo[^1]
[^1]: mercury mercury mercury mercury mercury mercury mercury mercury mercury mercury mercury
mercury mercury Is there another solution for formatting the markdown that I'm not considering? Or is this a problem to be fixed in |
Huh? I think you’re confusing something. Your first example fails now because footnotes are supported, and that last The fix is not your last example, but: foo[^1]
mercury mercury
[^1]: mercury mercury mercury mercury mercury mercury mercury mercury
mercury mercury mercury Or, if you want the p in the definition: foo[^1]
[^1]: mercury mercury mercury mercury mercury mercury mercury mercury
mercury mercury mercury
mercury mercury Better yet, I would not write on the first line: foo[^1]
[^1]:
mercury mercury mercury mercury mercury mercury mercury mercury
mercury mercury mercury
mercury mercury |
Ah, thank you! So, just to make sure I'm understanding correctly: What I'm seeing is because in 3.x, footnotes were ignored, and only non-GFM standard definitions were checked. But now GFM footnotes are included and being checked. Is that correct? |
To be clear: I know that last "mercury mercury" is a separate paragraph. That's what I want! In |
All three of the example solutions you provided are failing with
Here's what I'm getting with that markdown:
|
first 2 comments: yes! |
ahhh, full error message is interesting! |
Yes, GFM footnote definitions were new. Regular definitions had no children. Footnotes do. The things inside the footnote definition were seen as content after the definition! Done in https://github.com/remarkjs/remark-lint/releases/tag/remark-lint-final-definition%404.0.1 |
Confirmed the fix in remark-lint-final-definition@4.0.1 fixes the issue I'm seeing in my code base. Thanks for the quick fix! |
Initial checklist
Affected packages and versions
remark-lint-maximum-line-length 4.0.0
Link to runnable example
No response
Steps to reproduce
With the following
package.json
,.remarkrc
:The various samples now produce the following results when run as
./node_modules/.bin/remark -u lint -f test.md
Expected behavior
Ideally links at the end of lines wouldn't be linted, including ones with trailing punctuation. These cases did not lint prior to the 4.0.0 update
Actual behavior
See output
Runtime
No response
Package manager
No response
OS
No response
Build and bundle tools
No response
The text was updated successfully, but these errors were encountered: