markdownlint: MD047/single-trailing-newline bug?

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

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (11 by maintainers)

Commits related to this issue

Most upvoted comments

@mathiasbynens: Version 0.14.2 of markdownlint 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!!