Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 4d802c9

Properly handle whitespace after closing tag.

  • Participants
  • Parent commits 3a905ae

Comments (0)

Files changed (4)

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

 Revision history for XML-Grammar-Fiction.
 
+    * Properly handling whitespace after a closing tag in the Fiction-Text
+    proto-text. Like:
+        - "</b> foo" should be translated "</b> foo" instead of "</b>foo".
+
 0.4.0       Fri May 20 15:46:18 IDT 2011
     * Updated some of the bug report URLs to read "XML-Grammar-Fiction"
     instead of "XML-Grammar-Screenplay".

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

 {
     my $self = shift;
 
+    if (${$self->curr_line_ref()} =~ m{\G.*?\S})
+    {
+        return;
+    }
+
     $self->consume(qr{\s});
 
     return;

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

 before '_generate_text_unit_events' => sub {
     my $self = shift;
 
-    $self->skip_multiline_space() 
+    $self->skip_multiline_space();
 };
 
 sub _handle_open_para
 {
     my $self = shift;
 
-    $self->skip_space();
+    # $self->skip_space();
 
     return 1;
 }

File perl/modules/XML-Grammar-Fiction/t/fiction/proto-text-to-xml-using-custom-parser.t

 use strict;
 use warnings;
 
-use Test::More tests => 12;
+use Test::More tests => 13;
 
 use Test::XML;
 
         }
     );
 
+    if ($fn eq "sections-p-b-i")
+    {
+        # TEST
+        like (
+            $got_xml,
+            qr{</b> },
+            "Space after the </b>",
+        );
+    }
+
     # TEST*$num_texts
     is_xml ($got_xml, load_xml("t/fiction/data/xml/$fn.xml"),
         "Output of the Proto Text \"$fn\""