Add support for {{P|userprofile\appdata\locallow}}
This commit is contained in:
parent
640ad5e474
commit
4d570f1790
3 changed files with 65 additions and 57 deletions
12
src/wiki.ts
12
src/wiki.ts
|
@ -151,6 +151,10 @@ const PATH_ARGS: { [arg: string]: { mapped: string, when?: Constraint, registry?
|
|||
mapped: "<winDocuments>",
|
||||
when: { os: "windows" },
|
||||
},
|
||||
"userprofile\\appdata\\locallow": {
|
||||
mapped: "<winAppData>/LocalLow",
|
||||
when: { os: "windows" },
|
||||
},
|
||||
appdata: {
|
||||
mapped: "<winAppData>",
|
||||
when: { os: "windows" },
|
||||
|
@ -199,10 +203,10 @@ const PATH_ARGS: { [arg: string]: { mapped: string, when?: Constraint, registry?
|
|||
|
||||
function makePathArgRegex(arg: string): RegExp {
|
||||
const escaped = `{{P(ath)?|${arg}}}`
|
||||
.replace("\\", "\\\\")
|
||||
.replace("|", "\\|")
|
||||
.replace("{", "\\{")
|
||||
.replace("}", "\\}");
|
||||
.replace(/\\/g, "\\\\")
|
||||
.replace(/\|/g, "\\|")
|
||||
.replace(/\{/g, "\\{")
|
||||
.replace(/\}/g, "\\}");
|
||||
return new RegExp(escaped, "gi");
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue