mirror of
https://github.com/github/semantic.git
synced 2025-01-06 23:46:21 +03:00
Use choice
for markdown assignment
This commit is contained in:
parent
031a187c79
commit
fcf455f9b1
@ -61,7 +61,16 @@ assignment = Syntax.handleError $ makeTerm <$> symbol Document <*> children (Mar
|
|||||||
-- Block elements
|
-- Block elements
|
||||||
|
|
||||||
blockElement :: Assignment
|
blockElement :: Assignment
|
||||||
blockElement = paragraph <|> list <|> blockQuote <|> codeBlock <|> thematicBreak <|> htmlBlock <|> section <|> table
|
blockElement = choice
|
||||||
|
[ paragraph
|
||||||
|
, list
|
||||||
|
, blockQuote
|
||||||
|
, codeBlock
|
||||||
|
, thematicBreak
|
||||||
|
, htmlBlock
|
||||||
|
, section
|
||||||
|
, table
|
||||||
|
]
|
||||||
|
|
||||||
paragraph :: Assignment
|
paragraph :: Assignment
|
||||||
paragraph = makeTerm <$> symbol Paragraph <*> children (Markup.Paragraph <$> many inlineElement)
|
paragraph = makeTerm <$> symbol Paragraph <*> children (Markup.Paragraph <$> many inlineElement)
|
||||||
@ -106,7 +115,18 @@ tableCell = makeTerm <$> symbol TableCell <*> children (Markup.TableCell <$> man
|
|||||||
-- Inline elements
|
-- Inline elements
|
||||||
|
|
||||||
inlineElement :: Assignment
|
inlineElement :: Assignment
|
||||||
inlineElement = strong <|> emphasis <|> strikethrough <|> text <|> link <|> htmlInline <|> image <|> code <|> lineBreak <|> softBreak
|
inlineElement = choice
|
||||||
|
[ strong
|
||||||
|
, emphasis
|
||||||
|
, strikethrough
|
||||||
|
, text
|
||||||
|
, link
|
||||||
|
, htmlInline
|
||||||
|
, image
|
||||||
|
, code
|
||||||
|
, lineBreak
|
||||||
|
, softBreak
|
||||||
|
]
|
||||||
|
|
||||||
strong :: Assignment
|
strong :: Assignment
|
||||||
strong = makeTerm <$> symbol Strong <*> children (Markup.Strong <$> many inlineElement)
|
strong = makeTerm <$> symbol Strong <*> children (Markup.Strong <$> many inlineElement)
|
||||||
|
Loading…
Reference in New Issue
Block a user