Skip to content

Commit

Permalink
Fix return value of parsePlain API
Browse files Browse the repository at this point in the history
  • Loading branch information
marihachi committed Mar 28, 2021
1 parent d82b121 commit ecca995
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import peg from 'pegjs';
import { MfmNode } from './node';
import { MfmNode, MfmPlainNode } from './node';
import { stringifyNode, stringifyTree } from './util';
const parser: peg.Parser = require('./parser');

Expand All @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions src/node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
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' ];
Expand Down

0 comments on commit ecca995

Please sign in to comment.