Skip to content

Commit 8d82ac8

Browse files
committed
enh(shell) allow period in prompt match (#4244)
Allow a "." to match in the prompt section of shell/console examples.
1 parent 9a70b83 commit 8d82ac8

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Core Grammars:
1313
- fix(ex) adds support for `?'` char literal and missing `defguardp` keyword [Kevin Bloch][]
1414
- fix(diff) fix unified diff hunk header regex to allow unpaired numbers [Chris Wilson][]
1515
- enh(php) support single line and hash comments in attributes, constructor and functions [Antoine Musso][]
16+
- enh(shell) match period (.) as part of shell prompt [Ian Wienand][]
1617

1718
CONTRIBUTORS
1819

@@ -23,6 +24,7 @@ CONTRIBUTORS
2324
[Chris Wilson]: https://github.com/sushicw
2425
[Antoine Musso]: https://github.com/hashar
2526
[Chester Moses]: https://github.com/Chester-Moses-HCL
27+
[Ian Wienand]: https://github.com/ianw
2628

2729

2830
## Version 11.11.1

src/languages/shell.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function(hljs) {
2020
// We cannot add \s (spaces) in the regular expression otherwise it will be too broad and produce unexpected result.
2121
// For instance, in the following example, it would match "echo /path/to/home >" as a prompt:
2222
// echo /path/to/home > t.exe
23-
begin: /^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,
23+
begin: /^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,
2424
starts: {
2525
end: /[^\\](?=\s*$)/,
2626
subLanguage: 'bash'
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<span class="hljs-meta prompt_">~/git-repo[branch-1.0]$ </span><span class="language-bash"><span class="hljs-built_in">ls</span> a.file</span>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
~/git-repo[branch-1.0]$ ls a.file

0 commit comments

Comments
 (0)