Skip to main content
defaultntfl65knte3g
Known Participant
October 5, 2023
Answered

Remove underlines from bookmarks

  • October 5, 2023
  • 3 replies
  • 370 views

Using RH 2022.3.93 on Windows 11.
Recently upgraded (from RH 2019) and the text marked as a bookmark is now underlined, but wasn't in RH19. So, when I generate a PDF, the text looks like it has a hyperlink associated with it. I have hundreds of these, so how do I remove the underline from a bookmark?

For example:
<h4><a id="Modify_Parameters" name="Modify_Parameters">Modify Parameters</a></h4>

This is an example of a bookmark that shows up in PDF as underlined:

Modify Parameters

 

Why and how do I get rid of these fake underlines?

    This topic has been closed for replies.
    Correct answer Amebr

    It'll be because the <a> tag has styling applied.  However, I've styled the <a> tag for many, many years, so had stopped applying bookmarks over a text selection for probably 2 decades (probably when I went from generating only print output to generating online help). By default in RH2019 New UI, bookmarks are applied in front of the selected text, whereas in Classic the bookmark is applied over the selection, so I assume you have upgraded from Classic, rather than New UI (or else you were making manual changes in the code?).

     

    Anyway, going forward I would recommend applying the bookmark in front of the text rather than over it.

     

    However, in the meantime, try adding this to your stylesheet. It seemed to work in RH2019 New UI but I don't currently have RH2022 to test.

     

    a[name], a[id] {
        text-decoration: none;
        color: initial;  // you only need this line if the hyperlink is coloured
    }

    Do note that if you have any hyperlinks that have an id property, this rule will also remove the underline from the hyperlink. So make sure you test this thoroughly before going ahead.

     

    @Jeff_Coatsworth  id is the new way of doing name and can be applied to any element. name is deprecated.

    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#deprecated_attributes

    3 replies

    AmebrCommunity ExpertCorrect answer
    Community Expert
    October 5, 2023

    It'll be because the <a> tag has styling applied.  However, I've styled the <a> tag for many, many years, so had stopped applying bookmarks over a text selection for probably 2 decades (probably when I went from generating only print output to generating online help). By default in RH2019 New UI, bookmarks are applied in front of the selected text, whereas in Classic the bookmark is applied over the selection, so I assume you have upgraded from Classic, rather than New UI (or else you were making manual changes in the code?).

     

    Anyway, going forward I would recommend applying the bookmark in front of the text rather than over it.

     

    However, in the meantime, try adding this to your stylesheet. It seemed to work in RH2019 New UI but I don't currently have RH2022 to test.

     

    a[name], a[id] {
        text-decoration: none;
        color: initial;  // you only need this line if the hyperlink is coloured
    }

    Do note that if you have any hyperlinks that have an id property, this rule will also remove the underline from the hyperlink. So make sure you test this thoroughly before going ahead.

     

    @Jeff_Coatsworth  id is the new way of doing name and can be applied to any element. name is deprecated.

    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#deprecated_attributes

    Peter Grainge
    Community Expert
    Community Expert
    October 5, 2023

    I think someone had this issue a couple of years back. Might be worth searching.

     

    I think it was a long since fixed bug so not sure why you are seeing it in this version. 

    ________________________________________________________
    My site www.grainge.org includes many free Authoring and RoboHelp resources that may be of help.

     

    Use menu (bottom right) to mark as Best Answer or to Highlight particularly useful replies. Found the answer elsewhere? Share it here.
    Jeff_Coatsworth
    Community Expert
    Community Expert
    October 5, 2023

    What's the "<a id=" bit doing in there in your content?

    defaultntfl65knte3g
    Known Participant
    October 5, 2023

    I'm not sure. Either via the RH Upgrade or Word import procedure from an older version of RH.

    Why?

    Jeff_Coatsworth
    Community Expert
    Community Expert
    October 5, 2023

    Because I bet that's the source of the underlining - it thinks it's some link to something. Try removing it & testing to see if that assumption is correct.