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.

MD014 does not allow command output to start with empty line

See original GitHub issue

If the command output starts with an empty line, MD014 throws an error since change https://github.com/DavidAnson/markdownlint/commit/c4f77e021dc93626bc8ad465d2b70cb2a448af12. Some command outputs just start with an empty line, so I think this should be allowed, for example:

$ dig github.com

; <<>> DiG 9 <<>> github.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 166
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65394
;; QUESTION SECTION:
;github.com.			IN	A

;; ANSWER SECTION:
github.com.		13	IN	A	140.82.118.3

;; Query time: 14 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Tue Dec 24 11:37:17 CET 2019
;; MSG SIZE  rcvd: 55

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
DavidAnsoncommented, Dec 28, 2019

“if the block uses $ to mark commands, at least 1 command must show output without $.”

That’s an interesting way to think about this, thank you! I will keep that in mind when I go to fix this and see if it helps to do what you want without violating the general guidance.

1reaction
davidystephensoncommented, Dec 28, 2019

I’m not sure if this deserves its own issue, but there is also the problem of commands that do not have output, like cd. If cd is in the middle of a list of commands, the $ seems appropriate:

$ mkdir test
mkdir: created directory 'test'
$ cd test
$ ls test

When some commands do have output and others do not, the $ still indicates which lines are new commands and are which lines are output. In the linked guide, the second “good” example shows a line without output: https://cirosantilli.com/markdown-style-guide#dollar-signs-in-shell-code

Read more comments on GitHub >

github_iconTop Results From Across the Web

markdownlint/RULES.md at main - GitHub
Aliases: ul-start-left. This rule is triggered when top level lists don't start at the beginning of a line: Some text * List item...
Read more >
What is the preferred method to echo a blank line in a shell ...
All of these commands can be used to echo a blank line: echo , echo '' , echo "". We cant use echo...
Read more >
Markdownlint Rules - kiki
Using spaces to indent blank lines inside a list item is usually not necessary, ... MD014 - Dollar signs used before commands without...
Read more >
Markdownlint - Visual Studio Marketplace
Open Visual Studio Code; Press Ctrl+P / ⌘P to open the Quick Open dialog; Type ext install markdownlint to find the extension ·...
Read more >
How to stop the Windows command line from outputting an ...
will not have the empty line in between since above is the the trick that allows printing stuff without a trailing line break....
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