remove single p tag from impact/description
This commit is contained in:
parent
582406221a
commit
f05196d65d
@ -33,7 +33,11 @@
|
|||||||
|
|
||||||
<!-- remove h*, make bold paragraph -->
|
<!-- remove h*, make bold paragraph -->
|
||||||
<xsl:template match="h2 | h3 | h4 | h5">
|
<xsl:template match="h2 | h3 | h4 | h5">
|
||||||
<p><b><xsl:apply-templates/></b></p>
|
<p>
|
||||||
|
<b>
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</b>
|
||||||
|
</p>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- TODO: change <img src="/uploads/ac943b3c98d3630f7b1d787c00aa9417/file.png"/> to
|
<!-- TODO: change <img src="/uploads/ac943b3c98d3630f7b1d787c00aa9417/file.png"/> to
|
||||||
@ -41,13 +45,22 @@
|
|||||||
|
|
||||||
<!-- get rid of superfluous breaks before images or h3 tags -->
|
<!-- get rid of superfluous breaks before images or h3 tags -->
|
||||||
<!-- (not perfect, ideally post-process result later to flatten img or h3 out of p -->
|
<!-- (not perfect, ideally post-process result later to flatten img or h3 out of p -->
|
||||||
<xsl:template match="br[following-sibling::img] | br[following-sibling::h3] | br[following-sibling::p]">
|
<xsl:template
|
||||||
</xsl:template>
|
match="br[following-sibling::img] | br[following-sibling::h3] | br[following-sibling::p]"> </xsl:template>
|
||||||
|
|
||||||
<!-- insert default img width to nudge pentesters :) -->
|
<!-- insert default img width to nudge pentesters :) -->
|
||||||
<xsl:template match="img[not(@height) and not(@width)]">
|
<xsl:template match="img[not(@height) and not(@width)]">
|
||||||
<xsl:copy><xsl:attribute name="width">17</xsl:attribute>
|
<xsl:copy>
|
||||||
<xsl:apply-templates select="@* | node()"/></xsl:copy>
|
<xsl:attribute name="width">17</xsl:attribute>
|
||||||
|
<xsl:apply-templates select="@* | node()"/>
|
||||||
|
</xsl:copy>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
|
<!--if a description or an impact tag contains only a p, remove the p (unless it has element children).-->
|
||||||
|
<xsl:template
|
||||||
|
match="description/p[not(preceding-sibling::*)][not(following-sibling::*)][not(*)] | impact/p[not(preceding-sibling::*)][not(following-sibling::*)][not(*)]">
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user