| 85 | | parse : <skip: ''> Content |
| 86 | | |
| 87 | | Content : Paragraph |
| | 85 | parse : <skip: ''> Content(s) |
| | 86 | |
| | 87 | Content : Section | Paragraph |
| | 88 | |
| | 89 | Section : Heading |
| | 90 | { |
| | 91 | my $elm = element( $item[0] ); |
| | 92 | $elm->push_content( $item{'Heading'} ); |
| | 93 | $return = $elm; |
| | 94 | } |
| | 95 | |
| | 96 | Heading : <rulevar: local $text_re = qr{(?: (?! $exclude_re ) [^\n=] )+}x > |
| | 97 | Heading : /[=]{1,}/ InlineNode(s) "$item[1]" Blank Identifier(?) Blank /\n/ |
| | 98 | { |
| | 99 | my $elm = element( $item[0] ); |
| | 100 | |
| | 101 | my @text = @{ $item{'InlineNode(s)'} }; |
| | 102 | $text[0] =~ s{^[ \t]*}{}g if ( ! ref $text[0] ); |
| | 103 | $text[$#text] =~ s{[ \t]*$}{}g if ( ! ref $text[$#text] ); |
| | 104 | $elm->push_content( @text ); |
| | 105 | |
| | 106 | $elm->attr->{'id'} = $item{'Identifier(?)'}->[0] |
| | 107 | if ( $item{'Identifier(?)'}->[0] ); |
| | 108 | |
| | 109 | $return = $elm; |
| | 110 | } |