-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more modern YouTube embedding to XmlLegacy renderer. Externaliz…
…ed a few strings. This is not tested very thoroughly.
- Loading branch information
Showing
4 changed files
with
110 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<xsl:stylesheet | ||
version="1.0" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:php="http://php.net/xsl" | ||
exclude-result-prefixes="php" | ||
> | ||
<xsl:output method="xml" encoding="UTF-8" indent="no"/> | ||
|
||
<xsl:template match="youtube"> | ||
<div class="videoWrapper"> | ||
<iframe src="http://www.youtube.com/embed/{@id}" frameborder="0"></iframe> | ||
</div> | ||
</xsl:template> | ||
|
||
<xsl:template match="x"> | ||
<p>y</p> | ||
</xsl:template> | ||
|
||
<xsl:template match="code"> | ||
<xsl:copy-of select="php:function('__CLASS__::highlight', string(.), string(@lang))" /> | ||
</xsl:template> | ||
|
||
<xsl:template match="img/@src"> | ||
<xsl:attribute name="src"> | ||
<xsl:copy-of select="php:function('__CLASS__::imageUrl', string(.))" /> | ||
</xsl:attribute> | ||
</xsl:template> | ||
|
||
<xsl:template match="a/@href"> | ||
<xsl:attribute name="href"> | ||
<xsl:copy-of select="php:function('__CLASS__::linkUrl', string(.))" /> | ||
</xsl:attribute> | ||
</xsl:template> | ||
|
||
<!-- the identity template --> | ||
<xsl:template match="@*|node()"> | ||
<xsl:copy> | ||
<xsl:apply-templates select="@*|node()"/> | ||
</xsl:copy> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<p>Test1</p> | ||
|
||
<youtube id="uzQ4f35JMUk" /> | ||
|
||
<p>Test2</p> | ||
|
||
<youtube id="uzQ4f35JMUk" /> | ||
|
||
<p>Test3</p> | ||
|
||
<code lang="php"><![CDATA[ | ||
echo "bla"; | ||
]]></code> | ||
|
||
<p>Test4</p> | ||
|
||
<x>x_bla_x</x> | ||
|
||
<p>Test5</p> |