From 2e73432a51623d2211869824fcdc1d5dc4e6e4bf 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. --- Locale/Po4a/Text.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Locale/Po4a/Text.pm b/Locale/Po4a/Text.pm index 0edb376..77a5cbe 100644 --- a/Locale/Po4a/Text.pm +++ b/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