Skip to content
Snippets Groups Projects
Commit ecca995a authored by marihachi's avatar marihachi
Browse files

Fix return value of parsePlain API

parent d82b1214
No related branches found
No related tags found
No related merge requests found
import peg from 'pegjs';
import { MfmNode } from './node';
import { MfmNode, MfmPlainNode } from './node';
import { stringifyNode, stringifyTree } from './util';
const parser: peg.Parser = require('./parser');
......@@ -8,7 +8,7 @@ export function parse(input: string): MfmNode[] {
return nodes;
}
export function parsePlain(input: string): MfmNode[] {
export function parsePlain(input: string): MfmPlainNode[] {
const nodes = parser.parse(input, { startRule: 'plainParser' });
return nodes;
}
......
export type MfmNode = MfmBlock | MfmInline;
export type MfmPlainNode = MfmUnicodeEmoji | MfmEmojiCode | MfmText;
export type MfmBlock = MfmQuote | MfmSearch | MfmCodeBlock | MfmMathBlock | MfmCenter;
const blockTypes: MfmNode['type'][] = [ 'quote', 'search', 'blockCode', 'mathBlock', 'center' ];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment