From 69ac7b739f5579cfbdc392ad548c29f3cbfe7dde Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 15 Aug 2018 20:23:50 +0900 Subject: [PATCH] Improve MFM --- src/mfm/parse/elements/inline-code.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mfm/parse/elements/inline-code.ts b/src/mfm/parse/elements/inline-code.ts index 1dd5affa5..e4ab49958 100644 --- a/src/mfm/parse/elements/inline-code.ts +++ b/src/mfm/parse/elements/inline-code.ts @@ -14,11 +14,12 @@ export type TextElementInlineCode = { export default function(text: string) { const match = text.match(/^`(.+?)`/); if (!match) return null; + if (match[1].includes('ยด')) return null; const code = match[0]; return { type: 'inline-code', content: code, - code: code.substr(1, code.length - 2).trim(), - html: genHtml(code.substr(1, code.length - 2).trim()) + code: match[1], + html: genHtml(match[1]) } as TextElementInlineCode; }