[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#606337: po4a: [text] Add support for SiSU markup



Package: po4a
Version: 0.40.2-1
Severity: wishlist
Tags: patch

Please provide support for the SiSU markup language along the same lines as markdown and asciidoc which are supported as options in the Text module.

Currently the Debian Live manual translations of SiSU files (processed as [type: text]) are corrupted whenever we use SiSU point-form lists. SiSU cannot handle line wraps, and the po4a Text module fails to detect '_*' SiSU markup, which must appear at the beginning of the line and with no leading whitespace, as bullet points. Detecting these lines and adding the 'no-wrap' option as per the attached patch resolves the issue.

Thanks,
Ben
Index: lib/Locale/Po4a/Text.pm
===================================================================
--- lib/Locale/Po4a/Text.pm	(revision 2461)
+++ lib/Locale/Po4a/Text.pm	(working copy)
@@ -141,6 +141,14 @@
 
 my $asciidoc = 0;
 
+=item B<sisu>
+
+Handle documents in the SiSU format.
+
+=cut
+
+my $sisu = 0;
+
 =back
 
 =cut
@@ -156,6 +164,7 @@
     $self->{options}{'fortunes'} = 1;
     $self->{options}{'markdown'} = 1;
     $self->{options}{'nobullets'} = 1;
+    $self->{options}{'sisu'} = 1;
     $self->{options}{'tabs'} = 1;
     $self->{options}{'verbose'} = 1;
 
@@ -191,6 +200,7 @@
     }
 
     $asciidoc=1 if (defined $options{'asciidoc'});
+    $sisu=1 if (defined $options{'sisu'});
 }
 
 sub parse {
@@ -606,6 +616,13 @@
             do_paragraph($self,$paragraph,$wrapped_mode);
             $paragraph="$line\n";
             $wrapped_mode = 1;
+        } elsif ($sisu and
+                 (   $line =~ /^_\*/ )) { # bullet
+            # Preserve some SiSU markup as a single line
+            do_paragraph($self,$paragraph,$wrapped_mode);
+            $paragraph="$line\n";
+            $wrapped_mode = 0;
+            $end_of_paragraph = 1;
         } elsif ($tabs eq "split" and $line =~ m/\t/ and $paragraph !~ m/\t/s) {
             $wrapped_mode = 0;
             do_paragraph($self,$paragraph,$wrapped_mode);

Reply to: