Skip to content

Commit bbc5307

Browse files
adjust escaping
1 parent ed96276 commit bbc5307

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

.github/workflows/checks.yml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,6 @@ on:
88
permissions: read-all
99

1010
jobs:
11-
temp:
12-
runs-on: windows-2025
13-
steps:
14-
- shell: powershell
15-
run: |
16-
echo 'gh --help'
17-
gh --help
18-
19-
echo ''
20-
echo 'gh `--help'
21-
gh `--help
22-
23-
echo ''
24-
echo 'gh ``--help'
25-
gh ``--help
26-
27-
28-
echo ''
29-
echo "gh '--help'"
30-
gh '--help'
31-
32-
echo ''
33-
echo "gh '`--help'"
34-
gh '`--help'
35-
36-
echo ''
37-
echo "gh '``--help'"
38-
gh '``--help'
39-
40-
41-
echo ''
42-
echo "gh ' --help'"
43-
gh ' --help'
4411
check:
4512
name: ${{ matrix.what }}
4613
runs-on: ubuntu-24.04

src/internal/win/powershell.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export function getEscapeFunction() {
1616
const newlines = new RegExp(/\n/g);
1717
const backticks = new RegExp(/`/g);
1818
const redirects = new RegExp(/(^|[\s\u0085])([*1-6]?)(>)/g);
19+
const hyphens = new RegExp(/([\s\u0085])-/g);
1920
const specials1 = new RegExp(/(^|[\s\u0085])([#\-:<@\]])/g);
2021
const specials2 = new RegExp(/([$&'(),;{|}])/g);
2122

@@ -33,6 +34,7 @@ export function getEscapeFunction() {
3334
.replace(newlines, " ")
3435
.replace(backticks, "``")
3536
.replace(redirects, "$1$2`$3")
37+
.replace(hyphens, "$1`-")
3638
.replace(specials1, "$1`$2")
3739
.replace(specials2, "`$1");
3840

0 commit comments

Comments
 (0)