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

Commit

Permalink
fix reflink without ref
Browse files Browse the repository at this point in the history
save & copy literal text
  • Loading branch information
fperrad committed Mar 24, 2009
1 parent 6ebcba4 commit 6c33c05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Compiler.pir
Expand Up @@ -345,8 +345,7 @@ Return generated HTML for all of its children.

.sub 'html' :method :multi(_,['Markdown';'RefLink'])
.param pmc node
.local string content, image, key
content = self.'html_children'(node)
.local string key
key = node.'key'()
$P0 = get_hll_global [ 'Markdown';'HTML';'Compiler' ], '%ref'
$S0 = downcase key
Expand All @@ -359,10 +358,11 @@ Return generated HTML for all of its children.
title = escape_xml($S0)
goto L2
L1:
$S0 = key
$S0 .= content
$S0 = node.'text'()
goto L5
L2:
.local string content, image
content = self.'html_children'(node)
image = node.'image'()
if image goto L3
if content goto L4
Expand Down
6 changes: 4 additions & 2 deletions src/parser/actions.pm
Expand Up @@ -231,15 +231,17 @@ method ReferenceLink($/, $key) {
}

method ReferenceLinkDouble($/) {
my $mast := Markdown::RefLink.new( :key( ~$<Label>[1].text() ) );
my $mast := Markdown::RefLink.new( :key( ~$<Label>[1].text() ),
:text( $/.text() ) );
for $<Label>[0]<Inline> {
$mast.push( $( $_ ) );
}
make $mast;
}

method ReferenceLinkSingle($/) {
make Markdown::RefLink.new( :key( ~$<Label>.text() ) );
make Markdown::RefLink.new( :key( ~$<Label>.text() ),
:text( $/.text() ) );
}

method ExplicitLink($/) {
Expand Down

0 comments on commit 6c33c05

Please sign in to comment.