Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
allow inline in BlockQuote & ListBlock
Browse files Browse the repository at this point in the history
test "Auto links.text" pass
  • Loading branch information
fperrad committed Mar 27, 2009
1 parent ddc1372 commit 5124e85
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
16 changes: 12 additions & 4 deletions src/parser/actions.pm
Expand Up @@ -84,12 +84,16 @@ method SetextHeading2($/) {
}

method BlockQuote($/) {
make $( $<BlockQuoteRaw> );
my $mast := Markdown::BlockQuote.new();
for $<BlockQuoteRaw> {
$mast.push( $( $_ ) );
}
make $mast;
}

method BlockQuoteRaw($/) {
my $mast := Markdown::BlockQuote.new();
for $<Line> {
my $mast := Markdown::Node.new();
for $<Inline> {
$mast.push( $( $_ ) );
}
make $mast;
Expand Down Expand Up @@ -164,7 +168,11 @@ method ListItem($/) {
}

method ListBlock($/) {
make $( $<Line> );
my $mast := Markdown::Node.new();
for $<Inline> {
$mast.push( $( $_ ) );
}
make $mast;
}

method OrderedList($/, $key) {
Expand Down
10 changes: 5 additions & 5 deletions src/parser/grammar.pg
Expand Up @@ -70,16 +70,16 @@ token Heading {
}

token BlockQuote {
<BlockQuoteRaw>
<BlockQuoteRaw>+
{*}
}

token BlockQuoteRaw {
[
<._Chevron> ' '? <Line>
[ <!_Chevron> <!BlankLine> <Line> ]*
<._Chevron> ' '? <Inline>+
[ <!_Chevron> <!BlankLine> <Inline>+ ]*
<.BlankLine>*
]+
]
{*}
}

Expand Down Expand Up @@ -142,7 +142,7 @@ token ListItem {
}

token ListBlock {
<Line> <ListBlockLine>*
<Inline>+ <ListBlockLine>*
{*}
}

Expand Down

0 comments on commit 5124e85

Please sign in to comment.