From af60b45ee7823a3f01294a6fec238cee25f6ec79 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 16 Jun 2019 21:30:51 +0900 Subject: [PATCH] Fix MFM italic parsing --- src/mfm/language.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]); });