[Po4a-commits] r2597 - /trunk/lib/Locale/Po4a/Text.pm

barbier at users.alioth.debian.org barbier at users.alioth.debian.org
Wed Sep 26 21:04:40 UTC 2012


Author: barbier
Date: Wed Sep 26 21:04:39 2012
New Revision: 2597

URL: http://svn.debian.org/wsvn/po4a/?sc=1&rev=2597
Log:
Text.pm: define more Asciidoc styles

Reported by Anders Nawroth, thanks!

Modified:
    trunk/lib/Locale/Po4a/Text.pm

Modified: trunk/lib/Locale/Po4a/Text.pm
URL: http://svn.debian.org/wsvn/po4a/trunk/lib/Locale/Po4a/Text.pm?rev=2597&op=diff
==============================================================================
--- trunk/lib/Locale/Po4a/Text.pm (original)
+++ trunk/lib/Locale/Po4a/Text.pm Wed Sep 26 21:04:39 2012
@@ -367,6 +367,12 @@
     }
     return ($paragraph,$wrapped_mode,$expect_header,$end_of_paragraph);
 }
+
+my $asciidoc_RE_STYLE_ADMONITION = "TIP|NOTE|IMPORTANT|WARNING|CAUTION";
+my $asciidoc_RE_STYLE_PARAGRAPH = "normal|literal|verse|quote|listing|abstract|partintro|comment|example|sidebar|source|music|latex|graphviz";
+my $asciidoc_RE_STYLE_NUMBERING = "arabic|loweralpha|upperalpha|lowerroman|upperroman";
+my $asciidoc_RE_STYLE_LIST = "appendix|horizontal|qanda|glossary|bibliography";
+my $asciidoc_RE_STYLES = "$asciidoc_RE_STYLE_ADMONITION|$asciidoc_RE_STYLE_PARAGRAPH|$asciidoc_RE_STYLE_NUMBERING|$asciidoc_RE_STYLE_LIST|float";
 
 sub parse_asciidoc {
     my ($self,$line,$ref,$paragraph,$wrapped_mode,$expect_header,$end_of_paragraph) = @_;
@@ -482,7 +488,7 @@
         undef $self->{indent};
     } elsif (not defined $self->{verbatim} and
              ($paragraph eq "") and
-             ($line =~ m/^((?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):\s+)(.*)$/)) {
+             ($line =~ m/^((?:$asciidoc_RE_STYLE_ADMONITION):\s+)(.*)$/)) {
         my $type = $1;
         my $text = $2;
         do_paragraph($self,$paragraph,$wrapped_mode);
@@ -492,7 +498,7 @@
         undef $self->{bullet};
         undef $self->{indent};
     } elsif (not defined $self->{verbatim} and
-             ($line =~ m/^\[(NOTE|TIP|IMPORTANT|WARNING|CAUTION|verse|quote)\]$/)) {
+             ($line =~ m/^\[($asciidoc_RE_STYLES)\]$/)) {
         my $type = $1;
         do_paragraph($self,$paragraph,$wrapped_mode);
         $paragraph="";




More information about the Po4a-commits mailing list