documentation icon indicating copy to clipboard operation
documentation copied to clipboard

[BUG] Link to field `description` on article `package.json` is broken

Open LinqLover opened this issue 4 years ago • 6 comments

What / Why

image

When

Scroll down to the section description (not Description above)

Where

https://docs.npmjs.com/cli/v7/configuring-npm/package-json

How

URLs don't care about casing so the HTML anchor is ambiguous. Interestingly, the ToC uses a better strategy for creating unique anchors but the HTML content itself does not adopt this strategy.

Current Behavior

Cannot create a valid link to the field description

Steps to Reproduce

Option 1: Click here image Option 2: Click on description here image

Expected Behavior

Option 1: Link is invalid Option 2: Link refers to wrong section

LinqLover avatar Sep 11 '21 17:09 LinqLover

This is a known problem with a proposed PR here. Not sure if removing the original "description" is the solution here though.

wraithgar avatar Sep 13 '21 13:09 wraithgar

The proposed solution was not the right one, this is something that is going to need to be fixed in the docs site itself. It should be able to handle this (in fact the t.o.c appears to already try)

wraithgar avatar Sep 27 '21 20:09 wraithgar

@wraithgar what are you imagining the next steps here are"?

MylesBorins avatar Sep 28 '21 19:09 MylesBorins

@MylesBorins I have no idea where to start. There seems to be a bug with whatever markdown rendering library is being used when there are headers w/ duplicate names. The table of contents does it correctly, but the page itself does not.

wraithgar avatar Sep 28 '21 19:09 wraithgar

Github's markdown renderer also does not have this bug https://github.com/npm/cli/blob/latest/docs/content/configuring-npm/package-json.md#description-1

wraithgar avatar Sep 28 '21 19:09 wraithgar