summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-06-16 21:30:51 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-06-16 21:30:51 +0900
commitaf60b45ee7823a3f01294a6fec238cee25f6ec79 (patch)
tree684486e20e5cbc58070e39aa946642cb469cd279
parentFix test (diff)
downloadsharkey-af60b45ee7823a3f01294a6fec238cee25f6ec79.tar.gz
sharkey-af60b45ee7823a3f01294a6fec238cee25f6ec79.tar.bz2
sharkey-af60b45ee7823a3f01294a6fec238cee25f6ec79.zip
Fix MFM italic parsing
-rw-r--r--src/mfm/language.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mfm/language.ts b/src/mfm/language.ts
index 003ae348a4..7da1af7cff 100644
--- a/src/mfm/language.ts
+++ b/src/mfm/language.ts
@@ -98,7 +98,7 @@ export const mfmLanguage = P.createLanguage({
const text = input.substr(i);
const match = text.match(/^(\*|_)([a-zA-Z0-9]+?[\s\S]*?)\1/);
if (!match) return P.makeFailure(i, 'not a italic');
- if (input[i - 1] != null && input[i - 1].match(/[a-z0-9]/i)) return P.makeFailure(i, 'not a italic');
+ if (input[i - 1] != null && input[i - 1] != ' ' && input[i - 1] != '\n') return P.makeFailure(i, 'not a italic');
return P.makeSuccess(i + match[0].length, match[2]);
});