1. Shlomi Fish
  2. Fiction-XML

Commits

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

Extract a method - _paragraph_tag() to abstract differences in classes.

  • Participants
  • Parent commits 24980b2
  • Branches default

Comments (0)

Files changed (2)

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

View file
  • Ignore whitespace
     }
 }
 
+sub _paragraph_tag
+{
+    return "p";
+}
+
 sub _write_elem
 {
     my ($self, $args) = @_;
     {
         $self->_output_tag_with_childs(
             {
-               start => ["p"],
+                start => [$self->_paragraph_tag()],
                 elem => $elem,
             },
         );

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

View file
  • Ignore whitespace
     }
 }
 
+sub _paragraph_tag
+{
+    return "para";
+}
+
 sub _write_elem
 {
     my ($self, $args) = @_;
     {
         $self->_output_tag_with_childs(
             {
-               start => ["para"],
+               start => [$self->_paragraph_tag()],
                 elem => $elem,
             },
         );