markdown-conert: fix multiple code blocks

This commit is contained in:
Alex Schroeder
2018-11-16 23:48:52 +01:00
parent 06067dd1c1
commit c6b7d952bd
2 changed files with 14 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ sub MarkdownConvert {
print GetHeader('', Ts('Converting %s', $id), '');
$_ = GetPageContent($id);
s/^\{\{\{((?:.*\n)+)\}\}\}$/```$1```/gm;
s/^\{\{\{((?:.*\n)+?)\}\}\}$/```$1```/gm;
my $s = MarkdownConvertString('*');
s/\*$s\*/**$1**/g;

View File

@@ -17,7 +17,7 @@
require './t/test.pl';
package OddMuse;
use utf8;
use Test::More tests => 17;
use Test::More tests => 19;
add_module('markdown-converter.pl');
@@ -55,6 +55,16 @@ like $output, qr'```\ncode\n```', 'fenced code';
# Errors found and fixed at a later date
$input = qq{
/Toes Reach/
{{{
one
}}}
and
{{{
two
}}}
};
update_page('test', $input);
@@ -62,6 +72,8 @@ update_page('test', $input);
my $output = get_page('action=convert id=test');
like $output, qr'\*Toes Reach\*', 'Toes Reach';
like $output, qr'^```\none\n```$'m, 'code block one';
like $output, qr'^```\none\n```$'m, 'code block two';
# check whether the candidates are listed correctly