more gitlab export cleanups

This commit is contained in:
skyanth 2019-12-10 18:42:32 +01:00
parent 8a04af8494
commit 582406221a
2 changed files with 26 additions and 2 deletions

View File

@ -2,6 +2,8 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output indent="yes" method="xml"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
@ -29,8 +31,10 @@
<!-- remove @class from a -->
<xsl:template match="a/@class"/>
<!-- remove @alt from img -->
<xsl:template match="img/@alt"/>
<!-- remove h*, make bold paragraph -->
<xsl:template match="h2 | h3 | h4 | h5">
<p><b><xsl:apply-templates/></b></p>
</xsl:template>
<!-- TODO: change <img src="/uploads/ac943b3c98d3630f7b1d787c00aa9417/file.png"/> to
<img src="../screenshots/file.png"/> -->

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
<xsl:output indent="yes" method="xml"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="p[child::img[not(preceding-sibling::*)][not(following-sibling::*)]]">
<xsl:copy-of select="img"/>
</xsl:template>
</xsl:stylesheet>