diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-09-07 03:22:55 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2018-09-07 03:22:55 +0900 |
| commit | c6ff6939a5e9b443085cef7498af226915dfbb7f (patch) | |
| tree | 9362dfe2c69989b28e6ed3842b4832e85f648a30 /src/mfm/parse | |
| parent | Encode fetch URI if needed (#2649) (diff) | |
| download | sharkey-c6ff6939a5e9b443085cef7498af226915dfbb7f.tar.gz sharkey-c6ff6939a5e9b443085cef7498af226915dfbb7f.tar.bz2 sharkey-c6ff6939a5e9b443085cef7498af226915dfbb7f.zip | |
Add capitalize function (#2651)
Diffstat (limited to 'src/mfm/parse')
| -rw-r--r-- | src/mfm/parse/core/syntax-highlighter.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mfm/parse/core/syntax-highlighter.ts b/src/mfm/parse/core/syntax-highlighter.ts index 2b13608d2b..c5157ca1d3 100644 --- a/src/mfm/parse/core/syntax-highlighter.ts +++ b/src/mfm/parse/core/syntax-highlighter.ts @@ -1,3 +1,5 @@ +import { capitalize } from "../../../prelude/string"; + function escape(text: string) { return text .replace(/>/g, '>') @@ -89,7 +91,7 @@ const _keywords = [ ]; const keywords = _keywords - .concat(_keywords.map(k => k[0].toUpperCase() + k.substr(1))) + .concat(_keywords.map(capitalize)) .concat(_keywords.map(k => k.toUpperCase())) .sort((a, b) => b.length - a.length); |