Allow specifying a subject in our email element. Eg the xhtml content ```xml <email mailto="yes" subject="Ada and Zangemann">contact@fsfe.org</email> ``` Will now generate ```xml <a href="mailto:contact@fsfe.org?subject=Ada and Zangemann">contact@fsfe.org</a> ``` Which when clicked will open an email client, and correctly populate the subject. I also added the subject to all ada zangemann pages, and have documented it on the web features page. Resolves #2742 Co-authored-by: Darragh Elliott <me@delliott.net> Reviewed-on: #5281 Co-authored-by: delliott <delliott@fsfe.org> Co-committed-by: delliott <delliott@fsfe.org>
This commit was merged in pull request #5281.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
<xsl:template name="email" match="email">
|
||||
<xsl:param name="email" select="."/>
|
||||
<xsl:param name="mailto" select="@mailto"/>
|
||||
<xsl:param name="subject" select="@subject"/>
|
||||
<!-- Split email on each character, creating a <token>character</token> element each -->
|
||||
<xsl:variable name="email-tokens">
|
||||
<xsl:call-template name="tokenize">
|
||||
@@ -85,6 +86,11 @@
|
||||
-->
|
||||
<xsl:text disable-output-escaping="yes"><a href="mailto:</xsl:text>
|
||||
<xsl:value-of select="$email-encoded" disable-output-escaping="yes"/>
|
||||
<xsl:text>?</xsl:text>
|
||||
<xsl:if test="$subject">
|
||||
<xsl:text>subject=</xsl:text>
|
||||
<xsl:value-of select="$subject"/>
|
||||
</xsl:if>
|
||||
<xsl:text disable-output-escaping="yes">"></xsl:text>
|
||||
<xsl:value-of select="$email-encoded" disable-output-escaping="yes"/>
|
||||
<xsl:text disable-output-escaping="yes"></a></xsl:text>
|
||||
|
||||
Reference in New Issue
Block a user