Skip to content

Commit

Permalink
List Markdown fenced code block info string as text type [Jonas Smede…
Browse files Browse the repository at this point in the history
…gaard]

Closes #195
Thanks Hans-Christoph for reporting this.

I rewrote this commit because it was initially written against the
Debian package on salsa instead of the upstream source code on that
server. Thanks Jonas for fixing this bug anyway, that's still precious.
  • Loading branch information
mquinson committed Mar 20, 2020
1 parent 8bc01c3 commit ba52a91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/Locale/Po4a/Text.pm
Expand Up @@ -577,6 +577,7 @@ sub parse_markdown {
my $fence_space_between = $4;
my $info_string = $5;
# fenced code block
my $type = "Fenced code block".($info_string?" ($info_string)":"");
do_paragraph($self,$paragraph,$wrapped_mode);
$wrapped_mode = 0;
$paragraph="";
Expand All @@ -588,7 +589,7 @@ sub parse_markdown {
$paragraph .= "$nextline";
($nextline, $nextref) = $self->shiftline();
}
do_paragraph($self,$paragraph,$wrapped_mode);
do_paragraph($self,$paragraph,$wrapped_mode,$type);
$self->pushline($nextline);
$paragraph="";
$end_of_paragraph = 1;
Expand Down
10 changes: 5 additions & 5 deletions t/t-20-text/PandocFencedCodeBlocks.pot
Expand Up @@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#. type: Plain text
#. type: Fenced code block
#: t-20-text/PandocFencedCodeBlocks.md:1 t-20-text/PandocFencedCodeBlocks.md:23
#, no-wrap
msgid ""
Expand All @@ -25,7 +25,7 @@ msgid ""
"}\n"
msgstr ""

#. type: Plain text
#. type: Fenced code block
#: t-20-text/PandocFencedCodeBlocks.md:7
#, no-wrap
msgid ""
Expand All @@ -34,7 +34,7 @@ msgid ""
"~~~~~~~~~~\n"
msgstr ""

#. type: Plain text
#. type: Fenced code block ({#mycode .haskell .numberLines startFrom="100"})
#: t-20-text/PandocFencedCodeBlocks.md:13 t-20-text/PandocFencedCodeBlocks.md:35
#, no-wrap
msgid ""
Expand All @@ -43,13 +43,13 @@ msgid ""
" qsort (filter (>= x) xs)\n"
msgstr ""

#. type: Plain text
#. type: Fenced code block (haskell)
#: t-20-text/PandocFencedCodeBlocks.md:19 t-20-text/PandocFencedCodeBlocks.md:41
#, no-wrap
msgid "qsort [] = []\n"
msgstr ""

#. type: Plain text
#. type: Fenced code block
#: t-20-text/PandocFencedCodeBlocks.md:29
#, no-wrap
msgid ""
Expand Down

0 comments on commit ba52a91

Please sign in to comment.