MD047/single-trailing-newline bug?
See original GitHub issueReproduction steps:
git clone git@github.com:v8/v8.dev.git && cd v8.dev
npm install
(note: this includesmarkdownlint-cli@0.15.0
)npm install markdownlint-cli@0.16.0
markdownlint src/**/*.md
fails with the following error message:
src/blog/scanner.md: 95: MD047/single-trailing-newline Files should end with a single newline character
But, the last character in the file is definitely a U+000A LF character, as evidenced by hexdump
:
$ hexdump -C src/blog/scanner.md | tail
00003900 73 73 69 62 6c 65 2e 20 49 64 65 61 6c 6c 79 2c |ssible. Ideally,|
00003910 20 74 68 65 73 65 20 73 74 65 70 73 20 61 72 65 | these steps are|
00003920 20 61 75 74 6f 6d 61 74 65 64 20 61 73 20 70 61 | automated as pa|
00003930 72 74 20 6f 66 20 61 20 62 75 69 6c 64 20 70 72 |rt of a build pr|
00003940 6f 63 65 73 73 2c 20 69 6e 20 77 68 69 63 68 20 |ocess, in which |
00003950 63 61 73 65 20 79 6f 75 20 64 6f 6e e2 80 99 74 |case you don...t|
00003960 20 68 61 76 65 20 74 6f 20 77 6f 72 72 79 20 61 | have to worry a|
00003970 62 6f 75 74 20 69 74 20 77 68 65 6e 20 61 75 74 |bout it when aut|
00003980 68 6f 72 69 6e 67 20 63 6f 64 65 2e 0a |horing code..|
0000398d
Ref. https://github.com/DavidAnson/markdownlint/pull/176 https://github.com/igorshubovych/markdownlint-cli/issues/56
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (11 by maintainers)
Top Results From Across the Web
What's the point in adding a new line to the end of a file?
It's not about adding an extra newline at the end of a file, it's about not removing the newline that should be there....
Read more >single-trailing-newline - npm
Ensure a string has a single trailing newline based off it's dominant newline character.. Latest version: 1.0.0, last published: 7 years ago ...
Read more >Adding new closing tag =?> for keeping trailing newline
Hello everyone,. I'd like to propose adding a new closing tag =?> to the language. PHP currently removes the newline character immediately ...
Read more >Markdownlint Rules
MD047 - Files should end with a single newline character. Tags: blank_lines. Aliases: single-trailing-newline. Fixable: Most violations can be fixed by tooling.
Read more >Markdownlint - Visual Studio Marketplace
Extension for Visual Studio Code - Markdown linting and style checking ... MD047 single-trailing-newline - Files should end with a single ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mathiasbynens: Version
0.14.2
ofmarkdownlint
is now available. If you reinstall the CLI, it should pick up the new reference.Slightly simpler: https://dlaa.me/markdownlint/#%25m%23 Heading `<!--`
I will debug later from a real computer. 😃
Thanks for helping track this down, both of you!!