Skip to content

Commit

Permalink
Fix options build against latest nixpkgs
Browse files Browse the repository at this point in the history
It's now necessary to also escape `"` (i.e. `"`) in option ids,
otherwise the build will fail because `"` is not a valid part of an
XML element id.

See also NixOS/nixpkgs#196651 and the original
change in NixOS/nixpkgs#194035 (comment)
for further context.

The `translate` expression is directly taken from the nixpkgs's
`options-to-docbook.xsl`.
  • Loading branch information
Ma27 committed Oct 19, 2022
1 parent 91dee68 commit b75d312
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/options-to-docbook.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@
<variablelist>
<xsl:attribute name="xml:id"><xsl:value-of select="$elementId"/></xsl:attribute>
<xsl:for-each select="attrs">
<xsl:variable name="id" select="concat($optionIdPrefix, '-', str:replace(str:replace(str:replace(str:replace(attr[@name = 'name']/string/@value, '*', '_'), '&lt;', '_'), '>', '_'), '?', '_'))" />
<xsl:variable name="id" select="
concat(
$optionIdPrefix,
'-',
translate(
attr[@name = 'name']/string/@value,
'*&lt; >[]:&quot;',
'________'
)
)" />
<varlistentry>
<term xlink:href="#{$id}">
<xsl:attribute name="xml:id"><xsl:value-of select="$id"/></xsl:attribute>
Expand Down

0 comments on commit b75d312

Please sign in to comment.