Cereal Killer
Cereal Killer

Reputation: 3414

Markdown headers not displayed correctly in npm

Can somebody explain why headers in README.md, displayed correctly in github, are not rendered in npm (they are displayed like "#title")?

example: https://github.com/Cerealkillerway/versionUpdater (ok)

https://www.npmjs.com/package/version-updater (headers wrong)

Upvotes: 5

Views: 1942

Answers (1)

Chris
Chris

Reputation: 137108

npm uses markdown-it, which seems to require a space between hashes and text:

#This doesn't work
# This does

I would argue that this is good style, and should be used even if the first version does work. It's much more readable in plain text, which is a big part of Markdown's goal:

Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

Readability, however, is emphasized above all else. A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.

Upvotes: 4

Related Questions