1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-11-25 15:46:39 +09:00

Improve MFM

This commit is contained in:
syuilo 2018-08-15 20:23:50 +09:00
parent 9ccf9a2496
commit 69ac7b739f

View File

@ -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;
}