Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

epub3 sidebar title bug #249

Open
mosegontar opened this issue Oct 17, 2022 · 0 comments
Open

epub3 sidebar title bug #249

mosegontar opened this issue Oct 17, 2022 · 0 comments

Comments

@mosegontar
Copy link

I've run into an issue where I have the following markup:

    <sidebar>
      <title>Sidebar Title</title>
      <para>some text</para>
    </sidebar>

which is getting rendered as follows when running the epub3 stylesheets:

      <div class="sidebar" title="Sidebar Title" epub:type="sidebar">
        <div class="titlepage">
          <div>
            <div>
              <div class="-title"/>
            </div>
          </div>
        </div>
        <p>some text</p>
      </div>

I've tracked down the issue to what I believe is a missing prefix in the <xsl:template match="d:title" mode="sidebar.titlepage.recto.auto.mode"> template in the epub3/titlepage.templates.xsl stylesheet.

<xsl:template match="d:title" mode="sidebar.titlepage.recto.auto.mode">
<div xsl:use-attribute-sets="sidebar.titlepage.recto.style">
<xsl:call-template name="formal.object.heading">
<xsl:with-param name="object" select="ancestor-or-self::sidebar[1]"/>
</xsl:call-template>
</div>
</xsl:template>

When the formal.object.heading template is called with the object param, the value of object is grabbed from
<xsl:with-param name="object" select="ancestor-or-self::sidebar[1]"/>.

I've tested modifying the select to use the d prefix and target "ancestor-or-self::d:sidebar[1]".

This successfully produces the markup I expected:

     <div class="sidebar" title="Sidebar Title" epub:type="sidebar">
        <div class="titlepage">
          <div>
            <div>
              <div class="sidebar-title">Sidebar Title</div>
            </div>
          </div>
        </div>
        <p>some text</p>
      </div>

I've confirmed that this appears to be an issue (unless I've misunderstood) with both the 1.79.2 stylesheets available at
https://github.com/docbook/xslt10-stylesheets/releases/download/release/1.79.2/docbook-xsl-1.79.2.zip
and when building with the latest stylesheets in GitHub (I used the Dockerfile in the buildtools/ directory to build.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant