summaryrefslogtreecommitdiff
path: root/perl
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-05-31 09:49:22 +0200
committerJonas Smedegaard <dr@jones.dk>2008-05-31 09:49:22 +0200
commit6010a16bcfd29e419225eca92d70e9d9f070af32 (patch)
tree8f779c385e68f409b9649929ad3434107e8ce432 /perl
parentc1443bc8adc52a03b86cc3dc57a6848766093d25 (diff)
Fix po4a: Treat paragraph-based Markdown markup as such.
Diffstat (limited to 'perl')
-rw-r--r--perl/Locale/Po4a/Text.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/perl/Locale/Po4a/Text.pm b/perl/Locale/Po4a/Text.pm
index 0edb376..77a5cbe 100644
--- a/perl/Locale/Po4a/Text.pm
+++ b/perl/Locale/Po4a/Text.pm
@@ -175,17 +175,21 @@ sub parse {
$paragraph="";
$wrapped_mode = 1;
} elsif ($markdown and
- ( $line =~ m/^#/ # headline
- or $line =~ m/^>/ # blockquote
- or $line =~ m/[<>]/ # maybe html
- or $line =~ m/^"""/ # textblock inside macro end
- or $line =~ m/"""$/)) { # textblock inside macro begin
- # Found headline
+ ( $line =~ m/^#/)) {
+ # Found Markdown headline
$wrapped_mode = 0;
$paragraph .= $line."\n";
do_paragraph($self,$paragraph,$wrapped_mode);
$paragraph="";
$wrapped_mode = 1;
+ } elsif ($markdown and
+ ( $paragraph =~ m/^>/ # blockquote
+ or $paragraph =~ m/[<>]/ # maybe html
+ or $paragraph =~ m/^"""/ # textblock inside macro end
+ or $paragraph =~ m/"""$/)) { # textblock inside macro begin
+ # Found Markdown markup that might not survive wrapping
+ $wrapped_mode = 0;
+ $paragraph .= $line."\n";
} else {
if ($line =~ /^\s/) {
# A line starting by a space indicates a non-wrap