diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2015-05-07 09:40:56 +0200 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2015-05-07 09:40:56 +0200 |
commit | 5c30b19817dc95e39e57ffe860ff1e2412b61489 (patch) | |
tree | 1be26cfd32c974d41954456f1f12466fb0369d36 /gtkdoc-mkdb.in | |
parent | fe3c9462501210eb0fdc8dd948fad8670daaa79b (diff) | |
download | gtk-doc-5c30b19817dc95e39e57ffe860ff1e2412b61489.tar.gz |
mkdb: handle footnoots in the markdown parser
Handle docbook that contains non inline docbook. Previously the footnoote link
was creating a para break. Not the para stays intact.
Diffstat (limited to 'gtkdoc-mkdb.in')
-rwxr-xr-x | gtkdoc-mkdb.in | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in index 41336c9..bd2d838 100755 --- a/gtkdoc-mkdb.in +++ b/gtkdoc-mkdb.in @@ -391,6 +391,7 @@ my %MD_TEXT_LEVEL_ELEMENTS = ( "literal" => 1, "envar" => 1, "filename" => 1, "firstterm" => 1, + "footnote" => 1, "function" => 1, "manvolnum" => 1, "option" => 1, @@ -5005,16 +5006,18 @@ sub MarkDownParseBlocks { my $is_self_closing = defined($2); # FIXME: why do we need to skip https? here, if we generalize this to all # uri schemes we get parsing errors - if (! $MD_TEXT_LEVEL_ELEMENTS{$tag} && $tag !~ /^https?/) { + if (! $MD_TEXT_LEVEL_ELEMENTS{$tag} && $tag !~ /^https?/ && !defined($md_block->{"start"})) { push @md_blocks, $md_block; if ($is_self_closing) { + @TRACE@("self-closing docbook '$tag'"); $md_block = { type => "self-closing tag", text => $deindented_line }; $is_self_closing = 0; next OUTER; } + @TRACE@("new markup '$tag'"); $md_block = { type => "markup", text => $deindented_line, start => "<" . $tag . ">", @@ -5025,6 +5028,18 @@ sub MarkDownParseBlocks { $md_block->{"closed"} = 1; } next OUTER; + } else { + @TRACE@("text level docbook '$tag'"); + if (!defined($md_block->{"start"}) && $MD_TEXT_LEVEL_ELEMENTS{$tag}) { + $md_block->{"start"} = "<" . $tag . ">"; + $md_block->{"end"} = "</" . $tag . ">"; + $md_block->{"closed"} = 0; + @TRACE@("scanning for end of '$tag'"); + } + if (defined($md_block->{"start"}) && $deindented_line =~ /$md_block->{"end"}/) { + $md_block->{"closed"} = 1; + @TRACE@("found end of '$tag'"); + } } } elsif ($line =~ /^([ ]*)[*+-][ ](.*)/) { # li |