Skip to content

Commit

Permalink
don't duplicate IDs with sameas
Browse files Browse the repository at this point in the history
  • Loading branch information
rettinghaus committed Mar 31, 2020
1 parent 2d683f5 commit 903895a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
10 changes: 9 additions & 1 deletion mei2ly.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,15 @@
</xsl:if>
<xsl:if test="$useSvgBackend">
<xsl:text>\tweak output-attributes #&apos;</xsl:text>
<xsl:call-template name="setSvgAttr" />
<xsl:choose>
<xsl:when test="ancestor::mei:staff/descendant::mei:rest/@sameas = $restKey">
<!-- no IDs -->
<xsl:text>((class . rest)) </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="setSvgAttr" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="@color">
<xsl:text>\tweak color #</xsl:text>
Expand Down
4 changes: 2 additions & 2 deletions tests/merging-rests.mei
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
<staff n="1">
<layer n="1">
<rest dur="4" xml:id="rest01a" />
<rest dur="4" sameas="#rest02b" />
<rest dur="4" sameas="#rest02b" xml:id="rest01b" />
<rest dur="4" xml:id="rest01c" />
</layer>
<layer n="2">
<rest sameas="#rest01a" />
<rest sameas="#rest01a" xml:id="rest02a" />
<rest dur="4" xml:id="rest02b" loc="6" color="gray"/>
<rest dur="4" xml:id="rest02c" />
</layer>
Expand Down
12 changes: 6 additions & 6 deletions tests/merging-rests.preview.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 903895a

Please sign in to comment.