Page 1 of 1

Webhelp Common - menucascade produces <abbr>

Posted: Fri Apr 06, 2018 3:13 am
by mdslup
Using Oxygen 19.1 with the WebHelp Classic transformation.

Using MENUCASCADE with a series of UICONTROLs, such as:

<step>
<cmd>Select
<menucascade>
<uicontrol>Menu1</uicontrol>
<uicontrol>Menu2</uicontrol>
</menucascade>.</cmd>
</step>

produces HTML with an ABBR element:

<span class="ph cmd">
Select
<span class="ph menucascade">
<span class="ph uicontrol">Menu1</span>
<abbr title="and then"> > </abbr>
<span class="ph uicontrol">Menu2</span>
</span>

The fact that the ABBR has a title attribute puts a silly-looking dashed underline beneath the greater-than symbol in both Chrome and Firefox.

I have searched the entire plugin looking for what is responsible for setting this attribute, but I can't find it. Can anyone tell me where I can go to change it?

Re: Webhelp Common - menucascade produces <abbr>

Posted: Tue Apr 10, 2018 11:22 am
by bogdan_cercelaru
Hello,

By default, browsers are rendering the <abbr /> elements with a dotted underline. The underline tells readers that the word in question has extra information associated with it. More information can be found here: https://developer.mozilla.org/en-US/doc ... d_Acronyms

To remove the dotted underline, you should use the following CSS:

Code: Select all

abbr, abbr[title] {
text-decoration: none;
border-bottom: none;
}
Regards,
Bogdan

Re: Webhelp Common - menucascade produces <abbr>

Posted: Tue Apr 10, 2018 8:42 pm
by mdslup
OK, that works. Thanks.

Still, for my own knowledge, can you tell me where in the DITA Plugin this code is generated:

Code: Select all

<abbr title="and then"> > </abbr>
What if I wanted to change the TITLE attribute of the ABBR element?

Re: Webhelp Common - menucascade produces <abbr>

Posted: Thu Apr 12, 2018 3:46 pm
by bogdan_cercelaru
Hello,

The ">" character and the "and then" title are generated by the following template:

Code: Select all

<xsl:template match="*[contains(@class,' ui-d/uicontrol ')]" name="topic.ui-d.uicontrol">
<!-- insert an arrow with leading/trailing spaces before all but the first uicontrol in a menucascade -->
<xsl:if test="ancestor::*[contains(@class,' ui-d/menucascade ')]">
<xsl:variable name="uicontrolcount"><xsl:number count="*[contains(@class,' ui-d/uicontrol ')]"/></xsl:variable>
<xsl:if test="$uicontrolcount>'1'">
<xsl:variable name="a11y.text" as="text()?">
<xsl:call-template name="getVariable">
<xsl:with-param name="id" select="'a11y.and-then'"/>
</xsl:call-template>
</xsl:variable>
<abbr>
<xsl:if test="exists($a11y.text)">
<xsl:attribute name="title" select="$a11y.text"/>
</xsl:if>
<xsl:call-template name="getVariable">
<xsl:with-param name="id" select="'#menucascade-separator'"/>
</xsl:call-template>
</abbr>
</xsl:if>
</xsl:if>
<span class="uicontrol">
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="setidaname"/>
<xsl:apply-templates/>
</span>
</xsl:template>
found in the "DITA_OT_DIR/plugins/org.dita.xhtml/xsl/xslhtml/ui-d.xsl" file and are collected from the localization files ("DITA_OT_DIR\xsl\common\strings-en-us.xml" file for english).
If you only want to change the character inserted as a separator and / or the value of the "title" attribute, you could just change these in the corresponding localization files.

Regards,
Bogdan

Re: Webhelp Common - menucascade produces <abbr>

Posted: Fri Apr 13, 2018 2:40 am
by mdslup
THANKS!