Commits

Shlomi Fish  committed 43810e1

Got rid of trailing space.

  • Participants
  • Parent commits 29da9fd

Comments (0)

Files changed (115)

File perl/modules/XML-Grammar-Fiction/MANIFEST

 t/screenplay/to-docbook.t
 t/screenplay/to-tei.t
 t/screenplay/to-xhtml.t
+t/style-trailing-space.t
 META.json

File perl/modules/XML-Grammar-Fiction/contrib/docbook-to-fiction-xml-txt.pl

 my $ret = GetOptions(
     "o|output=s" => \$output_file,
     "help|h" => \$help,
-    "man" => \$man, 
+    "man" => \$man,
 );
 
 if (!defined($output_file))
 
     my @subs = $xpc->findnodes(q{./db:section}, $sect_elem);
 
-    return 
-          qq{<s id="} . _esc_for_attr($id) . qq{">\n\n} 
+    return
+          qq{<s id="} . _esc_for_attr($id) . qq{">\n\n}
         . qq{<title>} . _esc($title_text) . qq{</title>\n\n}
         .  join("\n\n", map { _esc($_->textContent()) } @paras)
         . join("\n\n", map { _out_section($_) } @subs)
-        . qq{</s>\n\n} 
+        . qq{</s>\n\n}
         ;
 }
 

File perl/modules/XML-Grammar-Fiction/extradata/fiction-xml-to-docbook.xslt

  />
 
 <xsl:template match="/">
-        <xsl:apply-templates select="//fic:body" />  
+        <xsl:apply-templates select="//fic:body" />
 </xsl:template>
 
 <xsl:template match="fic:body">
                     <xsl:otherwise>
                         <xsl:value-of select="@xml:id" />
                     </xsl:otherwise>
-                </xsl:choose> 
+                </xsl:choose>
             </db:title>
         </db:info>
         <xsl:apply-templates select="fic:section|fic:blockquote|fic:p|fic:ol|fic:ul|fic:programlisting" />

File perl/modules/XML-Grammar-Fiction/extradata/fiction-xml-to-html.xslt

  />
 
 <xsl:template match="/">
-        <xsl:apply-templates select="//fic:body" />  
+        <xsl:apply-templates select="//fic:body" />
 </xsl:template>
 
 <xsl:template match="fic:body">
             <div class="fiction story">
                 <xsl:attribute name="xml:id">
                     <xsl:value-of select="@xml:id" />
-                </xsl:attribute>                
+                </xsl:attribute>
                 <!-- TODO : duplicate code between here and fic:section.
-                    Abstract into a common functionality! 
+                    Abstract into a common functionality!
                 -->
                 <xsl:element name="h{count(ancestor-or-self::fic:section|ancestor-or-self::fic:body)}">
                     <xsl:value-of select="fic:title" />
                 </xsl:element>
-                
+
                 <xsl:apply-templates select="fic:section" />
             </div>
         </body>

File perl/modules/XML-Grammar-Fiction/extradata/fiction-xml.rng

         <optional>
             <attribute name="xml:id">
                 <data type="ID"/>
-            </attribute>            
+            </attribute>
         </optional>
         <optional>
             <attribute name="xml:lang">

File perl/modules/XML-Grammar-Fiction/extradata/screenplay-xml-to-docbook.xslt

  />
 
 <xsl:template match="/">
-        <xsl:apply-templates select="//sp:body" />  
+        <xsl:apply-templates select="//sp:body" />
 </xsl:template>
 
 <xsl:template match="sp:body">
                 <xsl:otherwise>
                     <xsl:value-of select="@id" />
                 </xsl:otherwise>
-            </xsl:choose> 
+            </xsl:choose>
         </title>
         <xsl:apply-templates select="sp:scene|sp:description|sp:saying" />
     </section>

File perl/modules/XML-Grammar-Fiction/extradata/screenplay-xml-to-html.xslt

  />
 
 <xsl:template match="/">
-        <xsl:apply-templates select="//sp:body" />  
+        <xsl:apply-templates select="//sp:body" />
 </xsl:template>
 
 <xsl:template match="sp:body">
 <xsl:template match="sp:para">
     <p>
         <xsl:if test="local-name(..) = 'saying'">
-            <strong class="sayer"><xsl:value-of select="../@character" />:</strong> 
+            <strong class="sayer"><xsl:value-of select="../@character" />:</strong>
             <xsl:text> </xsl:text>
         </xsl:if>
         <xsl:if test="local-name(..) = 'description' and ../child::sp:para[position()=1] = .">

File perl/modules/XML-Grammar-Fiction/extradata/screenplay-xml-to-tei.xslt

  />
 
 <xsl:template match="/">
-        <xsl:apply-templates select="//sp:body" />  
+        <xsl:apply-templates select="//sp:body" />
 </xsl:template>
 
 <xsl:template match="sp:body">

File perl/modules/XML-Grammar-Fiction/extradata/screenplay-xml-to-xsl-fo.xslt

 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
 
 <xsl:template match="/">
-        <xsl:apply-templates select="//body" />  
+        <xsl:apply-templates select="//body" />
 </xsl:template>
 
 <xsl:template match="body">
             </fo:layout-master-set>
             <fo:page-sequence master-reference="A4">
                 <fo:flow flow-name="xsl-region-body">
-                    <xsl:apply-templates select="scene" />        
+                    <xsl:apply-templates select="scene" />
                 </fo:flow>
             </fo:page-sequence>
     </fo:root>
 <xsl:template match="para">
     <p>
         <xsl:if test="local-name(..) = 'saying'">
-            <strong class="sayer"><xsl:value-of select="../@character" />:</strong> 
+            <strong class="sayer"><xsl:value-of select="../@character" />:</strong>
             <xsl:text> </xsl:text>
         </xsl:if>
         <xsl:if test="local-name(..) = 'description' and ../child::para[position()=1] = .">

File perl/modules/XML-Grammar-Fiction/inc/Test/Run/Builder.pm

         Test::Run::CmdLine::Iface->new(
             {
                 'test_files' => $self->get_test_run_test_files(),
-            }   
+            }
             # 'backend_params' => $self->_get_backend_params(),
         );
 
 
 sub ACTION_tags
 {
-    return 
+    return
         system(qw(
             ctags -f tags --recurse --totals
     		--exclude=blib/** --exclude=t/lib/**

File perl/modules/XML-Grammar-Fiction/inc/XML/Grammar/Builder.pm

     my $package = shift;
     my %args = @_;
     my @extradata_files;
-    
+
     my $builder = $package->SUPER::new(
         share_dir => 'extradata',
         auto_configure_requires => 1,

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction.pm

 
 =head1 NAME
 
-XML::Grammar::Fiction - CPAN distribution implementing an XML grammar 
+XML::Grammar::Fiction - CPAN distribution implementing an XML grammar
 and a lightweight markup language for stories, novels and other fiction.
 
 =head1 VERSION
 
 =head1 SYNOPSIS
 
-See L<XML::Grammar::Fiction::FromProto>, 
+See L<XML::Grammar::Fiction::FromProto>,
 L<XML::Grammar::Fiction::ToDocBook> and
 L<XML::Grammar::Fiction::ToHTML>.
 
 L<XML::Grammar::Fiction::App::ToHTML>, which are modules implementing
 command line applications for their processing.
 
-In order to be able to share the common code and functionality more easily, 
-then L<XML::Grammar::Screenplay>, which provides similar XML grammar and 
-text-based markup language for writing screenplays, is now included in this 
+In order to be able to share the common code and functionality more easily,
+then L<XML::Grammar::Screenplay>, which provides similar XML grammar and
+text-based markup language for writing screenplays, is now included in this
 CPAN distribution, and you can refer to its documentation as well:
 L<XML::Grammar::Screenplay> .
 
 =head2 Sections
 
 Sections are placed in XML-like tags of C<< <section> ... </section> >> or
-abbreviated as C<< <s> ... </s> >>. Opening tags in the format may have 
+abbreviated as C<< <s> ... </s> >>. Opening tags in the format may have
 attributes whose keys are plaintext and whose values are surrounded by
 double quotes. (Single-quotes are not supported).
 
 The section tag must have an C<id> attribute (for anchors, etc.) and could
-contain an optional (but highly recommended) C<< <title> >> sub-tag. If the 
+contain an optional (but highly recommended) C<< <title> >> sub-tag. If the
 title is not specified, it will default to the ID.
 
-Sections may be B<nested>. 
+Sections may be B<nested>.
 
 =head2 Text
 
 =item 3. Entities
 
 The text format supports SGML-like entities such as C<< &amp; >>,
-C<< &lt; >>, C<< &quot; >> and all other entities that are supported by 
+C<< &lt; >>, C<< &quot; >> and all other entities that are supported by
 L<HTML::Entities>.
 
 =item 4. Supported initial characters
 
 =item * XML/SGML entities.
 
-XML/SGML entities are also supported at the start. 
+XML/SGML entities are also supported at the start.
 
 =back
 
 =head3 Paragraphs
 
 These are not delimited by anything - just a paragraph of text not containing
-an empty line. If a paragraph starts with a Plus sign ( C<+> ) then it is 
-immediately expected to be followed by a styling tag (as opposed to a 
+an empty line. If a paragraph starts with a Plus sign ( C<+> ) then it is
+immediately expected to be followed by a styling tag (as opposed to a
 
 =head3 <ol>
 
 
 =head1 MOTIVATION
 
-I (= Shlomi Fish) originated this CPAN distribution (after forking 
+I (= Shlomi Fish) originated this CPAN distribution (after forking
 L<XML:Grammar::Screenplay> which was similar enough) so I'll have a convenient
-way to edit a story I'm writing in Hebrew and similar fiction, as 
-OpenOffice.org caused me many problems, and I found editing bi-directional 
+way to edit a story I'm writing in Hebrew and similar fiction, as
+OpenOffice.org caused me many problems, and I found editing bi-directional
 DocBook/XML to be painful with either gvim or KDE 4's kate, so I opted for a
 more plain-texty format.
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/App/FromProto.pm

     if ($e = Exception::Class->caught("XML::Grammar::Fiction::Err::Parse::TagsMismatch"))
     {
         warn $e->error(), "\n";
-        warn "Open: ", $e->opening_tag->name(), 
+        warn "Open: ", $e->opening_tag->name(),
             " at line ", $e->opening_tag->line(), "\n"
             ;
-        warn "Close: ", 
-            $e->closing_tag->name(), " at line ", 
+        warn "Close: ",
+            $e->closing_tag->name(), " at line ",
             $e->closing_tag->line(), "\n";
 
         exit(-1);

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/Err.pm

         "XML::Grammar::Fiction::Err::Base",
         "XML::Grammar::Fiction::Err::Parse::TagsMismatch" =>
         {
-            isa => "XML::Grammar::Fiction::Err::Base", 
+            isa => "XML::Grammar::Fiction::Err::Base",
             fields => [qw(opening_tag closing_tag)],
         },
         "XML::Grammar::Fiction::Err::Parse::LineError" =>
         "XML::Grammar::Fiction::Err::Parse::LeadingSpace" =>
         {
             isa => "XML::Grammar::Fiction::Err::Parse::LineError",
-        },        
+        },
         "XML::Grammar::Fiction::Err::Parse::CannotMatchOpeningTag" =>
         {
             isa => "XML::Grammar::Fiction::Err::Parse::LineError",

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto.pm

 {
     my ($self, $args) = @_;
 
-    return 
+    return
         $self->_output_tag({
             %$args,
             'in' => sub {
                 $self->_write_elem(
                     {
                         elem => $list,
-                    }                            
+                    }
                 ),
             },
         },
     my $scene = $args->{scene};
 
     my $tag = $scene->name;
-    
+
     if (($tag eq "s") || ($tag eq "scene"))
     {
         $self->_output_tag_with_childs_and_common_attributes(
         $contents = <$in>;
     }
     close($in);
-    
+
     return $contents;
 }
 
         @{$body->_get_childs()}
         ;
 
-    my @t = 
+    my @t =
     (
           defined($title)
         ? (title => $title->_get_childs()->[0])
     # These should be un-commented for debugging.
     # local $::RD_HINT = 1;
     # local $::RD_TRACE = 1;
-    
+
     # We need this so P::RD won't skip leading whitespace at lines
-    # which are siginificant.  
+    # which are siginificant.
 
     my $tree = $self->_calc_tree($args);
 
 
     my $buffer = "";
     my $writer = XML::Writer->new(
-        OUTPUT => \$buffer, 
+        OUTPUT => \$buffer,
         ENCODING => "utf-8",
         NAMESPACES => 1,
         PREFIX_MAP =>
     $self->_write_body({body => $tree});
 
     $writer->endTag();
-    
+
     return $buffer;
 }
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto/Nodes.pm

 extends("XML::Grammar::Fiction::FromProto::Node");
 
 has 'children' => (
-    isa => 'XML::Grammar::Fiction::FromProto::Node::List', 
+    isa => 'XML::Grammar::Fiction::FromProto::Node::List',
     is => 'rw'
 );
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/FromProto/Parser/QnD.pm

     return [qw(para)];
 }
 
-before '_handle_close_tag' => sub { 
+before '_handle_close_tag' => sub {
     my $self = shift;
 
     $self->skip_space();

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/Struct/Tag.pm

 
 =head1 NAME
 
-XML::Grammar::Fiction::Struct::Tag - information about an XML/SGML opening or 
+XML::Grammar::Fiction::Struct::Tag - information about an XML/SGML opening or
 closing tag.
 
 B<For internal use only>.
 has 'is_standalone' => (is => "rw", isa => "Bool");
 has 'attrs' => (is => "rw", isa => "ArrayRef");
 has 'children' => (
-    is => "rw", 
+    is => "rw",
     isa => "Maybe[ArrayRef]",
 );
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/ToDocBook.pm

 
 =head1 NAME
 
-XML::Grammar::Fiction::ToDocBook - module that converts the Fiction-XML to 
+XML::Grammar::Fiction::ToDocBook - module that converts the Fiction-XML to
 DocBook 5.
 
 =head1 VERSION
 
 Does the actual conversion. The C<'source'> argument points to a hash-ref with
 keys and values for the source. If C<'file'> is specified there it points to the
-filename to translate (currently the only available source). If 
+filename to translate (currently the only available source). If
 C<'string_ref'> is specified it points to a reference to a string, with the
 contents of the source XML. If C<'dom'> is specified then it points to an XML
 DOM as parsed or constructed by XML::LibXML.
 
-The C<'output'> key specifies the return value. A value of C<'string'> returns 
-the XML as a string, and a value of C<'dom'> returns the XML as an 
+The C<'output'> key specifies the return value. A value of C<'string'> returns
+the XML as a string, and a value of C<'dom'> returns the XML as an
 L<XML::LibXML> DOM object.
 
 =cut

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/ToHTML.pm

 
 Does the actual conversion. The C<'source'> argument points to a hash-ref with
 keys and values for the source. If C<'file'> is specified there it points to the
-filename to translate (currently the only available source). If 
+filename to translate (currently the only available source). If
 C<'string_ref'> is specified it points to a reference to a string, with the
 contents of the source XML. If C<'dom'> is specified then it points to an XML
 DOM as parsed or constructed by XML::LibXML.
 
-The C<'output'> key specifies the return value. A value of C<'string'> returns 
-the XML as a string, and a value of C<'dom'> returns the XML as an 
+The C<'output'> key specifies the return value. A value of C<'string'> returns
+the XML as a string, and a value of C<'dom'> returns the XML as an
 L<XML::LibXML> DOM object.
 
 =cut

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/FictionBase/FromProto/Parser/LineIterator.pm

 
 =head2 my $line_copy_ref = $self->curr_line_copy()
 
-Returns a reference to a copy of the current line that is allowed to be 
+Returns a reference to a copy of the current line that is allowed to be
 tempered with (by assigning to pos() or in a different way.). The line is
 returned as a reference so to avoid destroying its pos() value.
 
     my $l = ${$self->curr_line_ref()} . "";
 
     pos($l) = $self->curr_pos();
-    
+
     return \$l;
 }
 
 
 =head2 $self->curr_line_continues_with($regex)
 
-Matches the current line with $regex starting from the current position and 
-returns the result. The position remains at the original position if the 
+Matches the current line with $regex starting from the current position and
+returns the result. The position remains at the original position if the
 regular expression does not match (using C< qr//cg >).
 
 =cut
 
 =head2 my $line_number = $self->line_idx()
 
-Returns the line index as an integer. It starts from 0 for the 
+Returns the line index as an integer. It starts from 0 for the
 first line (like in Perl lines.)
 
 =head2 my $line_number = $self->line_num()
 
-Returns the line number as an integer. It starts from 1 for the 
+Returns the line number as an integer. It starts from 1 for the
 first line (like in file lines.)
 
 =cut
         # use of the variable.
         my $verdict = ($$l =~ m[\G(.*?)((?:${match_regex})|\z)]cgms);
         $return_value .= $1;
-        
+
         # Find if it matched the regex.
         if (length($2) > 0)
         {

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/FictionBase/FromProto/Parser/XmlIterator.pm

 (
     isa => "ArrayRef[XML::Grammar::FictionBase::Event]",
     # isa => "ArrayRef",
-    is => "rw", 
+    is => "rw",
     default => sub { []; },
     traits => ['Array'],
     handles =>
     my $args = shift;
 
     # t == type
-    my $class = 
+    my $class =
         "XML::Grammar::Fiction::FromProto::Node::"
         . delete($args->{'t'})
         ;
         $self->_new_node(
             {
                 t => (
-                    $open->name() eq "desc" ? "Description" 
+                    $open->name() eq "desc" ? "Description"
                     : $open->name() eq "innerdesc" ? "InnerDesc"
                     : "Element"
                 ),
             "Cannot match the \">\" of the opening tag",
         );
     }
-    
+
     return XML::Grammar::Fiction::Struct::Tag->new(
         name => $id,
         is_standalone => $is_standalone,
     my $self = shift;
     my $open_tag = shift;
 
-    my $new_elem = 
+    my $new_elem =
         $self->_create_elem(
-            $open_tag, 
+            $open_tag,
             $self->_new_list($open_tag->detach_children()),
         );
 
     }
 }
 
-sub _flush_events 
+sub _flush_events
 {
     my $self = shift;
 
     }
 }
 
-sub _is_closing_tag { 
+sub _is_closing_tag {
     my $self = shift;
     my $tag_start = shift;
 
 sub _generate_text_unit_events
 {
     my $self = shift;
-    
+
     # $self->skip_multiline_space();
 
     if (! $self->_generate_tag_event())
     {
         Carp::confess (qq{Reached EOF.});
     }
-    
+
     return;
 }
 
 sub _attempt_to_calc_new_ret_tag
 {
     my $self = shift;
-    
+
     $self->_ret_tag(scalar($self->_look_for_and_handle_tag()));
 
     return;
 
 =head1 DESCRIPTION
 
-This is a line iterator with some features for parsing, nested, 
+This is a line iterator with some features for parsing, nested,
 XML-like grammars.
 
 =head1 METHODS
 =cut
 
 sub process_text
-{   
+{
     my ($self, $text) = @_;
 
     $self->setup_text($text);

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/FictionBase/TagsTree2XML.pm

 );
 
 has "_parser" => (
-    'isa' => "XML::Grammar::Fiction::FromProto::Parser", 
+    'isa' => "XML::Grammar::Fiction::FromProto::Parser",
     'is' => "rw",
     lazy => 1,
-    default => sub { 
-        my $self = shift; 
+    default => sub {
+        my $self = shift;
         return $self->_parser_class->new();
     },
 );
         return;
     }
 }
-    
+
 sub _handle_elem_of_name_s
 {
     my ($self, $elem) = @_;

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/FictionBase/XSLT/Converter.pm

 
 =head1 NAME
 
-XML::Grammar::FictionBase::XSLT::Converter - base module that converts an XML 
+XML::Grammar::FictionBase::XSLT::Converter - base module that converts an XML
 file to a different XML file using an XSLT transform.
 
 =head1 VERSION
         XML::LibXML::RelaxNG->new(
             location =>
             File::Spec->catfile(
-                $self->_data_dir(), 
+                $self->_data_dir(),
                 $self->rng_schema_basename(),
             ),
         );
 
     my $style_doc = $self->_xml_parser()->parse_file(
             File::Spec->catfile(
-                $self->_data_dir(), 
+                $self->_data_dir(),
                 $self->xslt_transform_basename(),
             ),
         );
 
 Does the actual conversion. The C<'source'> argument points to a hash-ref with
 keys and values for the source. If C<'file'> is specified there it points to the
-filename to translate (currently the only available source). If 
+filename to translate (currently the only available source). If
 C<'string_ref'> is specified it points to a reference to a string, with the
 contents of the source XML. If C<'dom'> is specified then it points to an XML
 DOM as parsed or constructed by XML::LibXML.
 
-The C<'output'> key specifies the return value. A value of C<'string'> returns 
-the XML as a string, and a value of C<'dom'> returns the XML as an 
+The C<'output'> key specifies the return value. A value of C<'string'> returns
+the XML as a string, and a value of C<'dom'> returns the XML as an
 L<XML::LibXML> DOM object.
 
 =cut
           exists($source->{'dom'})
         ? $source->{'dom'}
         : exists($source->{'string_ref'})
-        ? $self->_xml_parser()->parse_string(${$source->{'string_ref'}}) 
+        ? $self->_xml_parser()->parse_string(${$source->{'string_ref'}})
         : $self->_xml_parser()->parse_file($source->{'file'})
         ;
 }
 {
     my $self = shift;
     my $args = shift;
-  
+
     my $source_dom = $self->_calc_and_ret_dom_without_validate($args);
 
     my $ret_code;

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay.pm

 
 =head1 NAME
 
-XML::Grammar::Screenplay - CPAN distribution implementing an XML grammar for 
+XML::Grammar::Screenplay - CPAN distribution implementing an XML grammar for
 screenplays.
 
 =head1 VERSION
 
 =head1 SYNOPSIS
 
-See L<XML::Grammar::Screenplay::FromProto>, 
+See L<XML::Grammar::Screenplay::FromProto>,
 L<XML::Grammar::Screenplay::ToDocBook> and
 L<XML::Grammar::Screenplay::ToHTML>.
 
 =head2 Scenes
 
 Scenes are placed in XML-like tags of C<< <section> ... </section> >> or
-abbreviated as C<< <s> ... </s> >>. Opening tags in the format may have 
+abbreviated as C<< <s> ... </s> >>. Opening tags in the format may have
 attributes whose keys are plaintext and whose values are surrounded by
 double quotes. (Single-quotes are not supported).
 
 =item 3. Entities
 
 The text format supports SGML-like entities such as C<< &amp; >>,
-C<< &lt; >>, C<< &quot; >> and all other entities that are supported by 
+C<< &lt; >>, C<< &quot; >> and all other entities that are supported by
 L<HTML::Entities>.
 
 =item 4. Text between [ ... ]
 Text between square brackets (C<[ ... ]>) is reserved for descriptions
 or inline descriptions (see below).
 
-=back 
+=back
 
 =head2 Sayings
 
 
 There are also internal descriptions to the saying which are placed
 inside the paragraph of the saying and describe what happens while the
-character talks. 
+character talks.
 
 =head2 EXAMPLES
 
 
     <s id="david_and_goliath">
 
-    [David and <a href="http://en.wikipedia.org/wiki/Goliath">Goliath</a> are 
+    [David and <a href="http://en.wikipedia.org/wiki/Goliath">Goliath</a> are
     standing by each other.]
 
     David: I will kill you.
 
     David: yes way!
 
-    ++++: In the name of <a href="http://real-allah.tld/">Allah, the 
+    ++++: In the name of <a href="http://real-allah.tld/">Allah, the
     <b>merciful</b>, real merciful</a>, I will show you
-    the [sarcastically] power of my sling. 
+    the [sarcastically] power of my sling.
 
     ++: I shall sling you and bing you till infinity.
 
 
 =head1 DEBUGGING
 
-When trying to convert the well-formed text to XML, one will often 
+When trying to convert the well-formed text to XML, one will often
 encounter an obscure "Parse Error". This is caused by L<Parse::RecDescent>,
 which is used for parsing. The best way I found to deal with it is to
 gradually eliminate parts of the document until the offending markup is

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay/FromProto.pm

 
     local $Parse::RecDescent::skip = "";
 
-    my $parser_class = 
+    my $parser_class =
         ($args->{parser_class} || "XML::Grammar::Screenplay::FromProto::Parser::QnD");
 
     $self->_parser(
 {
     my ($self, $args) = @_;
 
-    return 
+    return
         $self->_output_tag({
             %$args,
             'in' => sub {
     my $scene = $args->{scene};
 
     my $tag = $scene->name;
-    
+
     if (($tag eq "s") || ($tag eq "scene"))
     {
         my $id = $scene->lookup_attr("id");
         $contents = <$in>;
     }
     close($in);
-    
+
     return $contents;
 }
 
     # These should be un-commented for debugging.
     # local $::RD_HINT = 1;
     # local $::RD_TRACE = 1;
-    
+
     # We need this so P::RD won't skip leading whitespace at lines
-    # which are siginificant.  
+    # which are siginificant.
 
     my $tree = $self->_calc_tree($args);
 
 
     my $buffer = "";
     $self->_buffer(\$buffer);
-    
+
     my $writer = XML::Writer->new(
-        OUTPUT => $self->_buffer(), 
+        OUTPUT => $self->_buffer(),
         ENCODING => "utf-8",
         NAMESPACES => 1,
         PREFIX_MAP =>
     $writer->endTag();
 
     $writer->endTag();
-    
+
     return ${$self->_buffer()};
 }
 

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay/FromProto/Parser/QnD.pm

     {
         Carp::confess (qq{Two sayings in the tags stack at the same time.});
     }
-    
+
     return;
 };
 
 around '_parse_closing_tag' => sub {
     my ($orig, $self) = @_;
 
-    return 
+    return
         $self->_detect_closing_desc_tag
         ? $self->_create_closing_desc_tag
         : $self->$orig();
 
     $self->_set_is_start;
 
-    return 
+    return
         $self->_detect_open_desc_tag
         ? $self->_create_open_desc_tag
         : $self->$orig();
     if ($sayer =~ m{[\[\]]})
     {
         Carp::confess("Tried to put an inner-desc inside an addressing at line " . $self->line_num());
-    }    
+    }
 
     # All pluses
     if ($sayer =~ m{\A\++\z})
 }
 
 
-sub _is_closing_tag { 
+sub _is_closing_tag {
     my $self = shift;
     my $tag_start = shift;
 
         );
         $in_para = 0;
     }
-    
+
     if ( $is_saying && $self->_in_saying())
     {
         $self->_enqueue_event(
     # This is an assert.
     if ($open->name() ne "saying")
     {
-        Carp::confess (qq{Not a saying tag.});    
+        Carp::confess (qq{Not a saying tag.});
     }
-    
+
     my $new_elem =
         $self->_new_saying(
             (List::Util::first
     return;
 };
 
-before '_handle_close_tag' => sub { 
+before '_handle_close_tag' => sub {
     my $self = shift;
 
     $self->_close_top_tags();

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay/ToDocBook.pm

 =head2 $converter->translate_to_docbook({source => {file => $filename}, output => "string" })
 
 Does the actual conversion. $filename is the filename to translate (currently
-the only available source). 
+the only available source).
 
-The C<'output'> key specifies the return value. A value of C<'string'> returns 
-the XML as a string, and a value of C<'xml'> returns the XML as an 
+The C<'output'> key specifies the return value. A value of C<'string'> returns
+the XML as a string, and a value of C<'xml'> returns the XML as an
 L<XML::LibXML> DOM object.
 
 =cut

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay/ToHTML.pm

 =head2 $converter->translate_to_html({source => {file => $filename}, output => "string" })
 
 Does the actual conversion. $filename is the filename to translate (currently
-the only available source). 
+the only available source).
 
-The C<'output'> key specifies the return value. A value of C<'string'> returns 
-the XML as a string, and a value of C<'xml'> returns the XML as an 
+The C<'output'> key specifies the return value. A value of C<'string'> returns
+the XML as a string, and a value of C<'xml'> returns the XML as an
 L<XML::LibXML> DOM object.
 
 =cut

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Screenplay/ToTEI.pm

 =head2 $converter->translate_to_tei({source => {file => $filename}, output => "string" })
 
 Does the actual conversion. $filename is the filename to translate (currently
-the only available source). 
+the only available source).
 
-The C<'output'> key specifies the return value. A value of C<'string'> returns 
-the XML as a string, and a value of C<'xml'> returns the XML as an 
+The C<'output'> key specifies the return value. A value of C<'string'> returns
+the XML as a string, and a value of C<'xml'> returns the XML as an
 L<XML::LibXML> DOM object.
 
 =cut

File perl/modules/XML-Grammar-Fiction/rejects/QnD.pm

     my $self = shift;
 
     my ($sayer, $what);
-    
+
     ($sayer) = $self->_with_curr_line(
         sub {
             my $l = shift;
         $self->_new_node({
                 t => "Saying",
                 character => $first->{character},
-                children => 
+                children =>
                     $self->_new_list([ $first->{para}, @others ]),
         });
 }
     {
         Carp::confess (
             qq{Description ("[ ... ]") that started on line }
-            . ($start_line+1) . 
+            . ($start_line+1) .
             qq{does not terminate anywhere.}
         );
     }
             t => "Description",
             children => $self->_new_list(
             [
-                map { 
+                map {
                 $self->_new_para($_),
                 } @paragraphs
             ],),
     {
         if (!defined(${$self->_next_line_ref()}))
         {
-            Carp::confess 
+            Carp::confess
             (
                 "End of file in an addressing paragraph starting at "
                 . ($start_line+1)
     if ($$l =~ m{\G\&})
     {
         $which_tag = "entity";
-    }                
+    }
     elsif ($$l =~ m{\G(?:</|\])})
     {
         $which_tag = "close";

File perl/modules/XML-Grammar-Fiction/rejects/Screenplay_Parser_QnD.pm

 
     if ($open->{name} ne $close->{name})
     {
-        Carp::confess("Opening and closing tags do not match: " 
+        Carp::confess("Opening and closing tags do not match: "
             . "$open->{name} and $close->{name} on element starting at "
             . "line $open->{line}"
         );

File perl/modules/XML-Grammar-Fiction/rejects/lib/XML/Grammar/Fiction/FromProto/Parser/PRD.pm

         my $paragraphs = $item[2];
 
         XML::Grammar::Fiction::FromProto::Node::Description->new(
-            children => 
+            children =>
                 XML::Grammar::Fiction::FromProto::Node::List->new(
                     contents =>
                 [
-                map { 
+                map {
                 XML::Grammar::Fiction::FromProto::Node::Paragraph->new(
                     children =>
                         XML::Grammar::Fiction::FromProto::Node::List->new(
 }
 
 sub process_text
-{   
+{
     my ($self, $text) = @_;
 
     my $rv = $self->_p_rd()->start($text);

File perl/modules/XML-Grammar-Fiction/rejects/lib/XML/Grammar/Screenplay/FromProto/Parser/PRD.pm

         my $paragraphs = $item[2];
 
         XML::Grammar::Screenplay::FromProto::Node::Description->new(
-            children => 
+            children =>
                 XML::Grammar::Screenplay::FromProto::Node::List->new(
                     contents =>
                 [
-                map { 
+                map {
                 XML::Grammar::Screenplay::FromProto::Node::Paragraph->new(
                     children =>
                         XML::Grammar::Screenplay::FromProto::Node::List->new(
 }
 
 sub process_text
-{   
+{
     my ($self, $text) = @_;
 
     my $rv = $self->_p_rd()->start($text);

File perl/modules/XML-Grammar-Fiction/rejects/lib/XML/Grammar/Screenplay/Struct/Tag.pm

 
 =head1 NAME
 
-XML::Grammar::Screenplay::Struct::Tag - information about an XML/SGML opening or 
+XML::Grammar::Screenplay::Struct::Tag - information about an XML/SGML opening or
 closing tag.
 
 B<For internal use only>.
 has 'is_standalone' => (is => "rw", isa => "Bool");
 has 'attrs' => (is => "rw", isa => "ArrayRef");
 has 'children' => (
-    is => "rw", 
+    is => "rw",
     isa => "Maybe[ArrayRef]",
 );
 

File perl/modules/XML-Grammar-Fiction/rejects/proto-text-to-xml.t

 }
 
 my $rngschema = XML::LibXML::RelaxNG->new(
-        location => "./extradata/fiction-xml.rng" 
+        location => "./extradata/fiction-xml.rng"
     );
 
 my @tests = (qw(
         parser_class => "XML::Grammar::Screenplay::FromProto::Parser::PRD",
     });
 
-my $dtd = 
+my $dtd =
     XML::LibXML::Dtd->new(
         "Screenplay XML 0.1.0",
         File::Spec->catfile(
     my $dom = $xml_parser->parse_string($got_xml);
 
     # TEST*$num_texts
-    ok ($dom->validate($dtd), 
+    ok ($dom->validate($dtd),
         "Checking for validity of '$fn'"
     );
 
     ok ((defined($code) && ($code == 0)),
         "The validation of '$fn' succeeded.") ||
         diag("\$@ == $@");
-    
+
 }
 
 1;

File perl/modules/XML-Grammar-Fiction/t/app-to-html.t

 {
     local %ENV = %ENV;
     my @p5lib = split($Config{'path_sep'}, $ENV{'PERL5LIB'});
-    $ENV{'PERL5LIB'} = join($Config{'path_sep'}, 
+    $ENV{'PERL5LIB'} = join($Config{'path_sep'},
         File::Spec->rel2abs(
             File::Spec->catdir(
                 File::Spec->curdir(),
             "-e", "run()",
             "--",
             "-o", "temp.xhtml",
-            File::Spec->catdir(File::Spec->curdir(), 
+            File::Spec->catdir(File::Spec->curdir(),
                 "t", "fiction", "data", "xml", "sections-and-paras.xml",
             )
         ),

File perl/modules/XML-Grammar-Fiction/t/base/line-iterator-unit.t

     # Project Gutenberg - The Adventures of Sherlock Holmes by
     # Sir Arthur Conan Doyle.
     # http://www.gutenberg.org/files/1661/1661-h/1661-h.htm#2
-    my $text = <<"EOF"; 
+    my $text = <<"EOF";
 I had called upon my friend, Mr. Sherlock Holmes, one day in the autumn of
 last year and found him in deep conversation with a very stout,
 florid-faced, elderly gentleman with fiery red hair. With an apology for my
 greatcoat. As he glanced down the advertisement column, with his head thrust
 forward and the paper flattened out upon his knee, I took a good look at the
 man and endeavoured, after the fashion of my companion, to read the indications
-which might be presented by his dress or appearance. 
+which might be presented by his dress or appearance.
 
 EOF
 
     is ($parser->curr_pos(), 0, "->pos() returns the right value.");
 
     # TEST
-    ok (scalar($parser->at_line_start()), 
+    ok (scalar($parser->at_line_start()),
         "Parser is at line start.");
 
     {
         my ($l_ref, $pos) = $parser->curr_line_and_pos();
 
         # TEST
-        is ($$l_ref, 
+        is ($$l_ref,
             qq{I had called upon my friend, Mr. Sherlock Holmes, one day in the autumn of\n},
             "Line ref of ->curr_line_and_pos() is OK."
         );

File perl/modules/XML-Grammar-Fiction/t/fiction/data/docbook/a-href-with-id-and-lang.docbook.xml

       <title>The Top Section</title>
     </info>
     <para>
-        King <link xlink:href="http://en.wikipedia.org/wiki/David" xml:id="david_link" xml:lang="es">David</link> and Goliath were standing by each other.    
+        King <link xlink:href="http://en.wikipedia.org/wiki/David" xml:id="david_link" xml:lang="es">David</link> and Goliath were standing by each other.
     </para>
     <para>
     David said unto Goliath: "I will shoot you. I <emphasis role="bold">swear</emphasis> I will"

File perl/modules/XML-Grammar-Fiction/t/fiction/data/docbook/sections-a-href.docbook.xml

       <title>The Top Section</title>
     </info>
     <para>
-        King <link xlink:href="http://en.wikipedia.org/wiki/David">David</link> and Goliath were standing by each other.    
+        King <link xlink:href="http://en.wikipedia.org/wiki/David">David</link> and Goliath were standing by each other.
     </para>
     <para>
     David said unto Goliath: "I will shoot you. I <emphasis role="bold">swear</emphasis> I will"

File perl/modules/XML-Grammar-Fiction/t/fiction/data/docbook/sections-and-paras.docbook.xml

       <title>The Top Section</title>
     </info>
     <para>
-        David and Goliath were standing by each other.    
+        David and Goliath were standing by each other.
     </para>
     <para>
         David said unto Goliath: "I will shoot you."

File perl/modules/XML-Grammar-Fiction/t/fiction/data/docbook/sections-p-b-i-comments.docbook.xml

       <title>The Top Section</title>
     </info>
     <para>
-    David and Goliath were standing by each other.    
+    David and Goliath were standing by each other.
     </para>
     <para>
     David said unto Goliath: "I will shoot you. I <emphasis role="bold">swear</emphasis> I will"

File perl/modules/XML-Grammar-Fiction/t/fiction/data/docbook/with-blockquote-with-lang-and-id.docbook.xml

       <title>The Top Section</title>
     </info>
     <para>
-        King <link xlink:href="http://en.wikipedia.org/wiki/David">David</link> and Goliath were standing by each other.    
+        King <link xlink:href="http://en.wikipedia.org/wiki/David">David</link> and Goliath were standing by each other.
     </para>
     <para>
     David said unto Goliath: "I will shoot you. I <emphasis role="bold">swear</emphasis> I will"

File perl/modules/XML-Grammar-Fiction/t/fiction/data/docbook/with-blockquote.docbook.xml

       <title>The Top Section</title>
     </info>
     <para>
-        King <link xlink:href="http://en.wikipedia.org/wiki/David">David</link> and Goliath were standing by each other.    
+        King <link xlink:href="http://en.wikipedia.org/wiki/David">David</link> and Goliath were standing by each other.
     </para>
     <para>
     David said unto Goliath: "I will shoot you. I <emphasis role="bold">swear</emphasis> I will"

File perl/modules/XML-Grammar-Fiction/t/fiction/data/docbook/with-internal-description.docbook.xml

       <section role="description" id="id2244766"><title/>
             <para>
             [
-        
-                David and 
-                <ulink url="http://en.wikipedia.org/wiki/Goliath"/> 
+
+                David and
+                <ulink url="http://en.wikipedia.org/wiki/Goliath"/>
                 are standing by each other.
-            
+
             ]
         </para>
         </section>
                 yes way!
             </para>
             <para><emphasis role="bold">David: </emphasis>
-                In the name of <ulink url="http://real-allah.tld"/>, I will show you the 
-                <phrase>[sarcastically]</phrase> power 
+                In the name of <ulink url="http://real-allah.tld"/>, I will show you the
+                <phrase>[sarcastically]</phrase> power
                 of my sling.
             </para>
             <para><emphasis role="bold">David: </emphasis>
       <section role="description" id="id2242910"><title/>
             <para>
             [
-        
+
                 David takes his sling.
-            
+
             ]
         </para>
         </section>
       <section role="description" id="id2244795"><title/>
         <para>
             [
-        
+
             David puts a stone in his sling and shoots Goliath. He hits.
-        
+
             ]
         </para>
     </section>

File perl/modules/XML-Grammar-Fiction/t/fiction/data/docbook/with-programlisting.docbook.xml

       <title>The Top Section</title>
     </info>
     <para>
-    David and Goliath were standing by each other.    
+    David and Goliath were standing by each other.
     </para>
     <para>
     David said unto Goliath: "I will shoot you. I <emphasis role="bold">swear</emphasis> I will"

File perl/modules/XML-Grammar-Fiction/t/fiction/data/docbook/with-span.docbook.xml

       <title>The Top Section</title>
     </info>
     <para>
-        King <phrase xml:lang="he-IL">דוד</phrase> and <phrase xml:id="foobar">Foobar Anchor</phrase> and <phrase xml:id="peter" xml:lang="fr-FR">Pierre</phrase> and Goliath were standing by each other.    
+        King <phrase xml:lang="he-IL">דוד</phrase> and <phrase xml:id="foobar">Foobar Anchor</phrase> and <phrase xml:id="peter" xml:lang="fr-FR">Pierre</phrase> and Goliath were standing by each other.
     </para>
     <para>
     David said unto Goliath: "I will shoot you. I <emphasis role="bold">swear</emphasis> I will"

File perl/modules/XML-Grammar-Fiction/t/fiction/data/docbook/with-ul-ol-li.docbook.xml

       <title>The Top Section</title>
     </info>
     <para>
-        King <link xlink:href="http://en.wikipedia.org/wiki/David">David</link> and Goliath were standing by each other.    
+        King <link xlink:href="http://en.wikipedia.org/wiki/David">David</link> and Goliath were standing by each other.
     </para>
     <para>
     David said unto Goliath: "I will shoot you. I <emphasis role="bold">swear</emphasis> I will"

File perl/modules/XML-Grammar-Fiction/t/fiction/data/docbook/with-xml-lang-attr-in-section.docbook.xml

       <title>The Top Section</title>
     </info>
     <para>
-    David and Goliath were standing by each other.    
+    David and Goliath were standing by each other.
     </para>
     <para>
     David said unto Goliath: "I will shoot you. I <emphasis role="bold">swear</emphasis> I will"

File perl/modules/XML-Grammar-Fiction/t/fiction/data/docbook/with-xml-lang-attribute.docbook.xml

       <title>The Top Section</title>
     </info>
     <para>
-    David and Goliath were standing by each other.    
+    David and Goliath were standing by each other.
     </para>
     <para>
     David said unto Goliath: "I will shoot you. I <emphasis role="bold">swear</emphasis> I will"

File perl/modules/XML-Grammar-Fiction/t/fiction/data/proto-text-invalid/leading-space.txt

 
 <title>The Top Section</title>
 
-David and Goliath were standing by each other.    
+David and Goliath were standing by each other.
 
 David said unto Goliath: "I will shoot you. I <b>swear</b> I will". You shall
     feel my wrath!

File perl/modules/XML-Grammar-Fiction/t/fiction/data/proto-text-invalid/wrong-closing-inner-tag.txt

 
 <title>The Top Section</title>
 
-David and Goliath were standing by each other.    
+David and Goliath were standing by each other.
 
 David said unto Goliath: "I will shoot you. I <b>swear</i> I will"
 

File perl/modules/XML-Grammar-Fiction/t/fiction/data/proto-text/sections-p-b-i-comments.txt

 
 <!-- David has Green hair here -->
 
-David and Goliath were standing by each other.    
+David and Goliath were standing by each other.
 
 David said unto Goliath: "I will shoot you. I <b>swear</b> I will"
 

File perl/modules/XML-Grammar-Fiction/t/fiction/data/proto-text/sections-p-b-i.txt

 
 <title>The Top Section</title>
 
-David and Goliath were standing by each other.    
+David and Goliath were standing by each other.
 
 David said unto Goliath: "I will shoot you. I <b>swear</b> I will"
 

File perl/modules/XML-Grammar-Fiction/t/fiction/data/proto-text/with-blockquote-with-lang-and-id.txt

 
 </ol>
 
-Goliath was insulted and told David he should use bullets for the points, 
+Goliath was insulted and told David he should use bullets for the points,
 instead:
 
 <ul>