comparison third_party/highlight/languages/shell.js @ 192:b818a4561a3c hg-web

Added AI genreated README.md. Needed to be read.
author MrJuneJune <me@mrjunejune.com>
date Sat, 24 Jan 2026 21:52:14 -0800
parents
children
comparison
equal deleted inserted replaced
191:a06710325c30 192:b818a4561a3c
1 /*
2 Language: Shell Session
3 Requires: bash.js
4 Author: TSUYUSATO Kitsune <[email protected]>
5 Category: common
6 Audit: 2020
7 */
8
9 /** @type LanguageFn */
10 export default function(hljs) {
11 return {
12 name: 'Shell Session',
13 aliases: [
14 'console',
15 'shellsession'
16 ],
17 contains: [
18 {
19 className: 'meta.prompt',
20 // We cannot add \s (spaces) in the regular expression otherwise it will be too broad and produce unexpected result.
21 // For instance, in the following example, it would match "echo /path/to/home >" as a prompt:
22 // echo /path/to/home > t.exe
23 begin: /^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,
24 starts: {
25 end: /[^\\](?=\s*$)/,
26 subLanguage: 'bash'
27 }
28 }
29 ]
30 };
31 }