Commits

Shlomi Fish committed fb6e28f

Add the <img to to-xhtml.

  • Participants
  • Parent commits b0009d1

Comments (0)

Files changed (2)

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

     </strong>
 </xsl:template>
 
+<xsl:template match="sp:image">
+    <img>
+        <xsl:attribute name="src">
+            <xsl:value-of select="@url" />
+        </xsl:attribute>
+        <xsl:attribute name="title">
+            <xsl:value-of select="@title" />
+        </xsl:attribute>
+        <xsl:attribute name="alt">
+            <xsl:value-of select="@alt" />
+        </xsl:attribute>
+    </img>
+</xsl:template>
+
 <xsl:template match="sp:italics">
     <em class="italics">
         <xsl:apply-templates />

File perl/modules/XML-Grammar-Fiction/t/screenplay/to-xhtml.t

 
 use Test::More;
 
-use Test::XML tests => 3;
+use Test::XML tests => 6;
 
 use File::Spec;
 
 
 my @tests = (qw(
         with-internal-description
+        with-img-element-inside-paragraphs
     ));
 
 sub load_xml
     return $contents;
 }
 
-# TEST:$num_texts=1
+# TEST:$num_texts=2
 
 my $converter = XML::Grammar::Screenplay::ToHTML->new({
         data_dir => File::Spec->catdir(File::Spec->curdir(), "extradata"),