summaryrefslogtreecommitdiff
path: root/src/mfm/parse/core
diff options
context:
space:
mode:
authorAya Morisawa <AyaMorisawa4869@gmail.com>2018-08-25 22:42:26 +0900
committerAya Morisawa <AyaMorisawa4869@gmail.com>2018-08-25 22:42:26 +0900
commit08a59591ae25280cf11e49d0f5eab4d5a438e147 (patch)
tree58086582b6319664ed9571f45593d637e3f1a672 /src/mfm/parse/core
parentMerge branch 'develop' of https://github.com/syuilo/misskey into develop (diff)
downloadmisskey-08a59591ae25280cf11e49d0f5eab4d5a438e147.tar.gz
misskey-08a59591ae25280cf11e49d0f5eab4d5a438e147.tar.bz2
misskey-08a59591ae25280cf11e49d0f5eab4d5a438e147.zip
Use startsWith and endsWith for readability
Diffstat (limited to 'src/mfm/parse/core')
-rw-r--r--src/mfm/parse/core/syntax-highlighter.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mfm/parse/core/syntax-highlighter.ts b/src/mfm/parse/core/syntax-highlighter.ts
index 3fb7a3b73d..2b13608d2b 100644
--- a/src/mfm/parse/core/syntax-highlighter.ts
+++ b/src/mfm/parse/core/syntax-highlighter.ts
@@ -197,7 +197,7 @@ const elements: Element[] = [
if (thisIsNotARegexp) return null;
if (regexp == '') return null;
- if (regexp[0] == ' ' && regexp[regexp.length - 1] == ' ') return null;
+ if (regexp.startsWith(' ') && regexp.endsWith(' ')) return null;
return {
html: `<span class="regexp">/${escape(regexp)}/</span>`,