Skip to content

Commit 1658132

Browse files
authored
fix: sanitize < chars in markdown (#26469)
* fix: escape < chars * fix: rm angle brackets from wrangler before treating as markdown * lint: rm new lines; fix indentions
1 parent 4f2f821 commit 1658132

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

src/components/WranglerArg.astro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ const { key, definition } = props.parse(Astro.props);
1414
1515
const type = definition.type ?? definition.choices;
1616
const description = definition.description ?? definition.describe;
17+
const sanitizedDescription = description
18+
.replace(/</g, "&lt;")
19+
.replace(/>/g, "&gt;");
1720
const required = definition.demandOption;
1821
const defaultValue = definition.default;
1922
const alias = definition.alias;
@@ -44,5 +47,5 @@ if (alias) {
4447
{aliasText && <MetaInfo text={aliasText} />}
4548
{required && <MetaInfo text="required" />}
4649
{defaultValue !== undefined && <MetaInfo text={`default: ${defaultValue}`} />}
47-
<Fragment set:html={marked.parse(description)} />
50+
<Fragment set:html={marked.parse(sanitizedDescription)} />
4851
</li>

src/content/docs/workers/wrangler/commands.mdx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,16 +1299,14 @@ The minimum required wrangler version to use these commands is 3.40.0. For versi
12991299

13001300
<WranglerCommand
13011301
command="versions upload"
1302-
description="
1303-
Upload a new [version](/workers/configuration/versions-and-deployments/#versions) of your Worker that is not deployed immediately."
1302+
description="Upload a new [version](/workers/configuration/versions-and-deployments/#versions) of your Worker that is not deployed immediately."
13041303
headingLevel={3}
13051304
/>
13061305

13071306
<WranglerCommand
13081307
command="versions deploy"
1309-
description="Deploy a previously created [version](/workers/configuration/versions-and-deployments/#versions) of your Worker all at once or create a [gradual deployment](/workers/configuration/versions-and-deployments/gradual-deployments/) to incrementally shift traffic to a new version by following an interactive prompt."
1310-
headingLevel={3}
1311-
1308+
description="Deploy a previously created [version](/workers/configuration/versions-and-deployments/#versions) of your Worker all at once or create a [gradual deployment](/workers/configuration/versions-and-deployments/gradual-deployments/) to incrementally shift traffic to a new version by following an interactive prompt."
1309+
headingLevel={3}
13121310
/>
13131311

13141312
:::note
@@ -1322,16 +1320,13 @@ For example:
13221320

13231321
<WranglerCommand
13241322
command="versions list"
1325-
description="Retrieve details for the 10 most recent versions. Details include `Version ID`, `Created on`, `Author`, `Source`, and optionally, `Tag` or `Message`."
1326-
headingLevel={3}
1327-
1323+
description="Retrieve details for the 10 most recent versions. Details include `Version ID`, `Created on`, `Author`, `Source`, and optionally, `Tag` or `Message`."
1324+
headingLevel={3}
13281325
/>
13291326

13301327
<WranglerCommand
13311328
command="versions view"
1332-
1333-
headingLevel={3}
1334-
1329+
headingLevel={3}
13351330
/>
13361331

13371332
### `secret put`

src/content/warp-releases/windows/beta/2024.11.688.1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ releaseNotes: |
22
This release contains minor fixes and improvements.
33
44
**Changes and improvements:**
5-
- Consumers can now set the tunnel protocol using "warp-cli tunnel protocol set <proto>".
5+
- Consumers can now set the tunnel protocol using "warp-cli tunnel protocol set &lt;proto&gt;".
66
- Extended diagnostics collection time in warp-diag to ensure logs are captured reliably.
77
- Improved captive portal support by disabling the firewall during captive portal login flows.
88
- Improved captive portal detection on certain public networks.

0 commit comments

Comments
 (0)