npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

npm-markdown-bugs

v1.0.13

Published

Some example markdown bugs seen on npmjs.com.

Downloads

17

Readme

NPM Markdown Bugs

Here are a few Markdown bugs I've found while viewing READMEs on npmjs.com. For comparison, all of these view fine on GitHub using the same Markdown syntax.

Incorrect Code Indents

When indenting code using real tabs (not spaces), npmjs.com renders it with very odd spacing:

var server = new PixlServer({
	
	__name: 'MyServer',
	__version: "1.0",
	
	config: {
		"log_dir": "/var/log",
		"debug_level": 9,
		
		"Storage": {
			"engine": "File",
			"File": {
				"base_dir": "/var/data/myserver"
			}
		},
		
		"WebServer": {
			"http_port": 80,
			"http_htdocs_dir": "/var/www/html"
		},
		
		"API": {
			"base_uri": "/api"
		},
		
		"User": {
			"free_accounts": 0,
			"sort_global_users": 1
		}
	},
	
	components: [
		require('pixl-server-storage'),
		require('pixl-server-web'),
		require('pixl-server-api'),
		require('pixl-server-user')
	]
	
});

Basically, anything nested more than one tab deep is collapsed to the left side.

UPDATE: This appears to be a browser-specific issue. Safari v9.0.2 seems to render the nested tabs correctly, while Chrome v47 and Firefox v43 do not.

Tabs Are Rendered Extremely Wide

Tabs in code snippets are rendered extremely wide on npmjs.com. This here is one single tab:

{
	"code": 0,
	"location": "http://mycompany.com/usermanager/login.php?return="
}

Because the npmjs.com page content is locked at 740px width, it would be highly recommended to reduce the tab width, to about half of what it is.

Incorrect Nested List Indents

Nested lists don't seem to indent properly, especially when mixing numbered and bullet lists:

  1. This is an outer list item.
  2. This is an outer list item.
  3. This is an outer list item.
    • This is a nested bullet list item.
    • This is a nested bullet list item.
    • This is a nested bullet list item.

No Space After Lists

Nested lists seem to have a spacing issue below them:

  1. This is an outer list item.
  2. This is an outer list item.
  3. This is an outer list item.
    • This is a nested bullet list item.
    • This is a nested bullet list item.
    • This is a nested bullet list item.

Here is text below a list. On npmjs.com this text is crammed up against the list bottom.

Tables Centered By Default

Table content should align left unless explicitly set otherwise. On npmjs.com it is all centered by default:

| Header 1 | Header 2 | Header 3 | |----------|----------|----------| | Sample 1 | Sample 2 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. | | Sample 1 | Sample 2 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. | | Sample 1 | Sample 2 | Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |

Note: I am specifically referring to the table content, not the headers.

ASCII art is misaligned in text blocks

The following is a simple ASCII box with text inside:

┌───────────────────────────────────────────────┐
│ The quick brown fox jumped over the lazy dog. │
└───────────────────────────────────────────────┘

And this is an ASCII table with several rows and columns:

┌──────────┬────────────────┬───────────────────┬───────────────┐
│ Username │ Full Name      │ Email Address     │ Status        │
├──────────┼────────────────┼───────────────────┼───────────────┤
│ jhuckaby │ Joseph Huckaby │ [email protected] │ Administrator │
│ tsmith   │ Tom Smith      │ [email protected]   │ Active        │
│ dcook    │ David Cook     │ [email protected] │ Suspended     │
└──────────┴────────────────┴───────────────────┴───────────────┘

Both of these appear garbled on npmjs.com, with everything misaligned. I believe the font being used for text blocks is not truly monospace, and several of the ASCII art characters are actually double-width, when they should be single-width.

Specifically, I believe the character is being rendered double-width, and the character is also misaligned.

These boxes and tables appear fine on GitHub, and in various text editors and terminals I have tried.

Test

Test.

Test 2023-02-02.