1. Shlomi Fish
  2. Fiction-XML

Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 48b6d92

Refactored a method.

  • Participants
  • Parent commits e2d955b
  • Branches default

Comments (0)

Files changed (1)

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

View file
  • Ignore whitespace
 
     $self->skip_multiline_space();
 };
+sub _calc_open_para
+{
+    my $self = shift;
+
+    return
+        XML::Grammar::Fiction::Struct::Tag::Para->new(
+            name => "p",
+            is_standalone => 0,
+            line => $self->line_num(),
+            attrs => [],
+            children => [],
+        );
+}
 
 sub _handle_open_para
 {
     my ($self, $event) = @_;
 
-    my $new_elem = 
-        XML::Grammar::Fiction::Struct::Tag::Para->new(
-            name => "p",
-            is_standalone => 0,
-            line => $self->line_num(),
-            attrs => [],
-        );
-
-    $new_elem->children([]);
-
-    $self->_push_tag($new_elem);
+    $self->_push_tag($self->_calc_open_para());
 
     $self->_in_para(1);