build/email-subjects (#5281)
continuous-integration/drone/push Build is passing

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:
2025-09-08 05:46:53 +00:00
committed by tobiasd
parent b523e45db4
commit 235d86bed9
7 changed files with 16 additions and 6 deletions
+6
View File
@@ -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">&lt;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">"&gt;</xsl:text>
<xsl:value-of select="$email-encoded" disable-output-escaping="yes"/>
<xsl:text disable-output-escaping="yes">&lt;/a&gt;</xsl:text>