Skip to content

Commit 5600609

Browse files
committed
Use markdown syntax in mdx where possible
Closes #788
1 parent 893df3d commit 5600609

27 files changed

+45
-101
lines changed

.eslintrc.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ module.exports = {
4343
},
4444
rules: {
4545
'no-irregular-whitespace': 'off',
46-
'jsx-a11y/anchor-has-content': 'off',
47-
'react/jsx-no-target-blank': 'off',
4846
},
4947
},
5048
],

cli/lib/extract.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ const unpackTarball = async ({release, cwd, dir}) => {
3737
// the v6 version of the funding page has json not inside a code
3838
.replace(/(:\n\n)(\s{4}"funding": {)/g, '$1```json\n$2')
3939
.replace(/^(\s{4}]$)(\n\n)/gm, '$1\n```$2')
40+
// anchor links to markdown. this regex does need to match spaces and newlines since the source markdown
41+
// already has some links where attributes are separated by newlines
42+
.replace(
43+
/<a[\s\n]href="(.*?)"(?:[\s\n]target="_blank")?(?:[\s\n]rel="[a-z\s]+")?>(.*?)<\/a>/g,
44+
(_, href, text) => `[${href}](${text.trim()})`,
45+
)
4046
)
4147
}
4248

content/cli/v10/commands/npm-audit.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ The `sig` is generated using the following template: `${package.name}@${package.
9999

100100
Keys response:
101101

102-
- `expires`: null or a simplified extended <a href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 format</a>: `YYYY-MM-DDTHH:mm:ss.sssZ`
102+
- `expires`: null or a simplified extended [https://en.wikipedia.org/wiki/ISO_8601](ISO 8601 format): `YYYY-MM-DDTHH:mm:ss.sssZ`
103103
- `keydid`: sha256 fingerprint of the public key
104104
- `keytype`: only `ecdsa-sha2-nistp256` is currently supported by the npm CLI
105105
- `scheme`: only `ecdsa-sha2-nistp256` is currently supported by the npm CLI
106106
- `key`: base64 encoded public key
107107

108-
See this <a href="https://registry.npmjs.org/-/npm/v1/keys" target="_blank">example key's response from the public npm registry</a>.
108+
See this [https://registry.npmjs.org/-/npm/v1/keys](example key's response from the public npm registry).
109109

110110
### Audit Endpoints
111111

content/cli/v10/commands/npm-team.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Teams must always be fully qualified with the organization/scope they belong to
5555

5656
If you have two-factor authentication enabled in `auth-and-writes` mode, then you can provide a code from your authenticator with `[--otp <otpcode>]`. If you don't include this then you will be taken through a second factor flow based on your `authtype`.
5757

58-
- create / destroy: Create a new team, or destroy an existing one. Note: You cannot remove the `developers` team, <a href="https://docs.npmjs.com/about-developers-team" target="_blank">learn more.</a>
58+
- create / destroy: Create a new team, or destroy an existing one. Note: You cannot remove the `developers` team, [https://docs.npmjs.com/about-developers-team](learn more.)
5959

6060
Here's how to create a new team `newteam` under the `org` org:
6161

content/cli/v10/commands/npm-unpublish.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ redirect_from:
4141
npm unpublish [<package-spec>]
4242
```
4343

44-
To learn more about how the npm registry treats unpublish, see our <a
45-
href="https://docs.npmjs.com/policies/unpublish" target="_blank"
46-
rel="noopener noreferrer"> unpublish policies</a>
44+
To learn more about how the npm registry treats unpublish, see our [https://docs.npmjs.com/policies/unpublish](unpublish policies)
4745

4846
### Warning
4947

content/cli/v6/commands/npm-team.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Teams must always be fully qualified with the organization/scope they belong to
4141

4242
If you have two-factor authentication enabled in `auth-and-writes` mode, then you can provide a code from your authenticator with `[--otp <otpcode>]`. If you don't include this then you will be prompted.
4343

44-
- create / destroy: Create a new team, or destroy an existing one. Note: You cannot remove the `developers` team, <a href="https://docs.npmjs.com/about-developers-team" target="_blank">learn more.</a>
44+
- create / destroy: Create a new team, or destroy an existing one. Note: You cannot remove the `developers` team, [https://docs.npmjs.com/about-developers-team](learn more.)
4545
- add / rm: Add a user to an existing team, or remove a user from a team they belong to.
4646

4747
- ls: If performed on an organization name, will return a list of existing teams under that organization. If performed on a team, it will instead return a list of all users belonging to that particular team.

content/cli/v6/commands/npm-unpublish.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ If no version is specified, or if all versions are removed then the root package
4545

4646
Even if a package version is unpublished, that specific name and version combination can never be reused. In order to publish the package again, a new version number must be used. If you unpublish the entire package, you may not publish any new versions of that package until 24 hours have passed.
4747

48-
To learn more about how unpublish is treated on the npm registry, see our <a href="https://www.npmjs.com/policies/unpublish" target="_blank" rel="noopener noreferrer"> unpublish policies</a>.
48+
To learn more about how unpublish is treated on the npm registry, see our [https://www.npmjs.com/policies/unpublish](unpublish policies).
4949

5050
### See Also
5151

content/cli/v7/commands/npm-team.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Teams must always be fully qualified with the organization/scope they belong to
4141

4242
If you have two-factor authentication enabled in `auth-and-writes` mode, then you can provide a code from your authenticator with `[--otp <otpcode>]`. If you don't include this then you will be prompted.
4343

44-
- create / destroy: Create a new team, or destroy an existing one. Note: You cannot remove the `developers` team, <a href="https://docs.npmjs.com/about-developers-team" target="_blank">learn more.</a>
44+
- create / destroy: Create a new team, or destroy an existing one. Note: You cannot remove the `developers` team, [https://docs.npmjs.com/about-developers-team](learn more.)
4545

4646
Here's how to create a new team `newteam` under the `org` org:
4747

content/cli/v7/commands/npm-unpublish.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ redirect_from:
2121

2222
### Synopsis
2323

24-
To learn more about how the npm registry treats unpublish, see our <a
25-
href="https://docs.npmjs.com/policies/unpublish" target="_blank"
26-
rel="noopener noreferrer"> unpublish policies</a>
24+
To learn more about how the npm registry treats unpublish, see our [https://docs.npmjs.com/policies/unpublish](unpublish policies)
2725

2826
#### Unpublishing a single version of a package
2927

content/cli/v8/commands/npm-audit.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ The `sig` is generated using the following template: `${package.name}@${package.
7979

8080
Keys response:
8181

82-
- `expires`: null or a simplified extended <a href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 format</a>: `YYYY-MM-DDTHH:mm:ss.sssZ`
82+
- `expires`: null or a simplified extended [https://en.wikipedia.org/wiki/ISO_8601](ISO 8601 format): `YYYY-MM-DDTHH:mm:ss.sssZ`
8383
- `keydid`: sha256 fingerprint of the public key
8484
- `keytype`: only `ecdsa-sha2-nistp256` is currently supported by the npm CLI
8585
- `scheme`: only `ecdsa-sha2-nistp256` is currently supported by the npm CLI
8686
- `key`: base64 encoded public key
8787

88-
See this <a href="https://registry.npmjs.org/-/npm/v1/keys" target="_blank">example key's response from the public npm registry</a>.
88+
See this [https://registry.npmjs.org/-/npm/v1/keys](example key's response from the public npm registry).
8989

9090
### Audit Endpoints
9191

0 commit comments

Comments
 (0)