Skip to content

Commit

Permalink
fix: message-parser Unordered List definition (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed May 6, 2021
1 parent 4722cdf commit 6c659b8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
15 changes: 10 additions & 5 deletions packages/message-parser/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type OrderedList = {
};

export type UnorderedList = {
type: 'ORDERED_LIST';
type: 'UNORDERED_LIST';
value: ListItem[];
};

Expand Down Expand Up @@ -75,8 +75,6 @@ export type Quote = {
value: Paragraph[];
};

export type Blocks = Code | Heading | Quote | Paragraph;

export type Markup = Italic | Strike | Bold | Plain;
export type MarkupExcluding<T extends Markup> = Exclude<Markup, T>;

Expand Down Expand Up @@ -180,6 +178,13 @@ export type Inlines =
| Emoji
| Color;

export type Markdown = Array<Inlines | Blocks> | [BigEmoji];
export type Blocks =
| Code
| Heading
| Quote
| ListItem
| Tasks
| OrderedList
| UnorderedList;

export type ASTMessage = Blocks[];
export type MarkdownAST = Array<Paragraph | Blocks> | [BigEmoji];
6 changes: 3 additions & 3 deletions packages/message-parser/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ASTMessage } from './definitions';
import { MarkdownAST } from './definitions';
import { parse } from './grammar.pegjs';

export * from './definitions';

export { isNodeOfType } from './guards';

export const parser = (input: string): ASTMessage => parse(input);
export { MarkdownAST };
export const parser = (input: string): MarkdownAST => parse(input);

0 comments on commit 6c659b8

Please sign in to comment.