Commits

Shlomi Fish committed fb6e28f

Add the <img to to-xhtml.

Comments (0)

Files changed (2)

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 />

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"),
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.