[MFM] Improve various parsing

Resolve #2779
Resolve #3053
This commit is contained in:
syuilo 2018-11-16 21:57:19 +09:00
parent e3b8495431
commit 0ff390ed80
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
7 changed files with 79 additions and 46 deletions

View file

@ -8,7 +8,9 @@ export type TextElementQuote = {
quote: string;
};
export default function(text: string, isBegin: boolean) {
export default function(text: string, before: string) {
const isBegin = before == '';
const match = text.match(/^"([\s\S]+?)\n"/) || text.match(/^\n>([\s\S]+?)(\n\n|$)/) ||
(isBegin ? text.match(/^>([\s\S]+?)(\n\n|$)/) : null);