From 6010a16bcfd29e419225eca92d70e9d9f070af32 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 31 May 2008 09:49:22 +0200 Subject: Fix po4a: Treat paragraph-based Markdown markup as such. --- perl/Locale/Po4a/Text.pm | 16 ++++++++++------ 1 file 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 -- cgit v1.2.3