question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MD047/single-trailing-newline bug?

See original GitHub issue

Reproduction steps:

  1. git clone git@github.com:v8/v8.dev.git && cd v8.dev
  2. npm install (note: this includes markdownlint-cli@0.15.0)
  3. npm install markdownlint-cli@0.16.0
  4. 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:closed
  • Created 4 years ago
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
DavidAnsoncommented, May 18, 2019

@mathiasbynens: Version 0.14.2 of markdownlint is now available. If you reinstall the CLI, it should pick up the new reference.

3reactions
DavidAnsoncommented, May 17, 2019

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!!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found