Changeset 0d7e9a26 for stylesheets


Ignore:
Timestamp:
01/20/2024 07:24:10 AM (8 months ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
12.1, 12.2, gimp3, ken/TL2024, lazarus, plabs/newcss, rahul/power-profiles-daemon, trunk, xry111/for-12.3, xry111/llvm18, xry111/spidermonkey128
Children:
d989d56
Parents:
865ea30
Message:

Fix output of anchors with same id in sect3

The template for sect3.titlepage generates:
<h3 class="sect3">

<a id="{id of sect3}" name="{id of sect3}"></a>
<h4 class="title">

<a id="{id of sect3}" name="{id of sect3}">i{title of sect3}</a>

</h4>

</h3>
resulting in double definition of the same id, which is a validity error
in XML documents.
Replace with the same template as for sect2, using h3 instead of h2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stylesheets/lfs-xsl/xhtml/lfs-titles.xsl

    r865ea30 r0d7e9a26  
    128128
    129129    <!-- sect3.titlepage:
    130            Uses h3 and removed a lot of unneeded code.
    131            Use generic titlepage.mode template in case there are child
    132             elements (xref)-->
     130         Same as sect2 except it uses h3 -->
    133131    <!-- The original template is in {docbook-xsl}/xhtml/titlepage.templates.xsl -->
    134132  <xsl:template name="sect3.titlepage">
    135     <h3 class="{name(.)}">
    136       <xsl:if test="@id">
    137         <a id="{@id}" name="{@id}"/>
    138       </xsl:if>
    139       <xsl:if test="$section.autolabel != 0">
    140         <xsl:apply-templates select="." mode="label.markup"/>
    141         <xsl:text>. </xsl:text>
    142       </xsl:if>
    143       <xsl:apply-templates select="./title" mode="titlepage.mode"/>
    144     </h3>
     133    <xsl:choose>
     134      <xsl:when test="string-length(title) = 0"/>
     135      <xsl:otherwise>
     136        <h3 class="{name(.)}">
     137          <xsl:if test="@id">
     138            <a id="{@id}" name="{@id}"/>
     139          </xsl:if>
     140          <xsl:if test="not(ancestor::preface) and $section.autolabel != 0">
     141            <xsl:apply-templates select="." mode="label.markup"/>
     142            <xsl:text>. </xsl:text>
     143          </xsl:if>
     144          <xsl:value-of select="title"/>
     145        </h3>
     146      </xsl:otherwise>
     147    </xsl:choose>
    145148  </xsl:template>
    146 
    147149    <!-- dedication.titlepage:
    148150           Uses h2 and removed a lot of unneeded code. -->
Note: See TracChangeset for help on using the changeset viewer.