Skip to content

Commit

Permalink
feat(ExtendedToken): support template files on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
bhsd-harry committed Sep 16, 2024
1 parent 61067bd commit fa141ea
Show file tree
Hide file tree
Showing 66 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v1.12.8

*2024-09-16*

**Fixed**

- [`Token.prototype.expand`](https://github.com/bhsd-harry/wikiparser-node/wiki/Token#expand) now supports file names containing `` as a substitute for `:` in a Windows file system

## v1.12.7

*2024-08-24*
Expand Down
2 changes: 1 addition & 1 deletion addon/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const expand = (
} else if (!path.isAbsolute(Parser.templateDir)) {
Parser.templateDir = path.join(__dirname, '..', '..', Parser.templateDir);
}
const titles = [title, title.replaceAll('_', ' ')],
const titles = [title, title.replaceAll('_', ' ')].flatMap(tt => [tt, tt.replaceAll(':', '꞉')]),
file = ['.wiki', '.txt', '']
.flatMap(ext => titles.map(tt => path.join(Parser.templateDir!, tt + ext)))
.find(fs.existsSync);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
"chalk": "^4.1.2"
},
"devDependencies": {
"@bhsd/common": "^0.0.0",
"@bhsd/common": "^0.1.0",
"@codemirror/lint": "^6.8.0",
"@types/node": "^20.11.6",
"codejar-async": "^4.2.0",
"monaco-editor": "^0.51.0",
"v8r": "^3.0.0"
},
"engines": {
"node": "^20.9.0"
"node": ">=20.9.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fa141ea

Please sign in to comment.