Skip to main content
Beth_Pickett
Known Participant
April 17, 2017
Answered

Hyperlinks with id attribute with <a href>?

  • April 17, 2017
  • 1 reply
  • 1088 views

I just upgraded from RoboHelp 10 to 2017 (yes, a bit of a leap). While still using RH 10, I was asked to change all popup links in one of our projects to regular <a href> links that display in a window. Easy enough, searched and replaced, it was done.

Now I've upgraded to RH 2017 and need to perform the same search and replace in another project. However, now the same operation inserts an id attribute with a unique number on each link, which appears to make a global search and replace impossible, at least within RH. I think it's inserting extra quotation marks, also, which isn't helping matters.

Why can't I do a straight search and replace on the code without any HTML policing or whatever is going on? Or am I missing something?

This topic has been closed for replies.
Correct answer Peter Grainge

The dialog appears different because I displayed the Find tab and it's different than the Replace tab.


Using Regular Expressions would be a solution to this problem but there's a design problem doing that within RoboHelp. You can use regular expressions in the Find settings but not in the Replace settings. The solution to anything other than a manual edit has to be regular expressions using a tool other than RoboHelp. The freeware Text Crawler is one example. This does of course depend on whether you know how to use regular expressions. If not, maybe one of your developers could help? Not all developers are skilled in their use so don't take that as being part of their skillset.

<a href="javascript:BSSCPopup('../Gloss/Default_g.htm');" id="A3">default</a>

You defined <a href="../Gloss/Default_g.htm">default</a> as what you want and if you remove what I have coloured red, that is what you get.

The regular expression would find the whole string and because of the way it is written, it would split it into five parts. In the Replace expression, it would delete parts two and four leaving one, three and five. The beauty of regular expressions is that they can capture strings such as _g and A3 even though the characters vary from one find to another.

Before embarking on this, create a backup first. You can wreck a project much quicker than you can create it. Warp speed by comparison. I always recommend creating the backup as a zip file. That prevents you opening it accidentally and working on it before you realise it was the backup. This way you always have a clean backup that can be used to create a new clean copy time after time.


See www.grainge.org for RoboHelp and Authoring information

@petergrainge

1 reply

Captiv8r
Legend
April 17, 2017

Hi there

I believe you have the ability to use wildcard characters in the Multi File Find and Replace tool.

My thought is that you could use the wildcards to overcome that "unique" bit of information that seems to be tripping you up.

Cheers... Rick

Beth_Pickett
Known Participant
April 17, 2017

Hi Rick,

Thanks for the response. I think it's more complicated than that. Here's an example using the glossary term "default." (We use a manual glossary, not RoboHelp's automated one.) Here it is as a popup. RoboHelp added the id attribute when it converted the project to RoboHelp 2017.

     <a href="javascript:BSSCPopup('../Gloss/Default_g.htm');" id="A3">default</a>

I've got 300 or so of these in this project, and they all must become regular links:

     <a href="../Gloss/Default_g.htm">default</a>

As I said before, it was simple in the old software, because the unique id attributes weren't there, and I think fewer quotation marks. Nor can I enter a partial string like

     <a href="javascript:BSSCPopup('../Gloss/

and replace it with

     <a href="../Gloss/

because the incomplete syntax causes a wreck. That is, text disappears, it inserts text that shouldn't be there, crazy stuff. The syntax wouldn't be incomplete if RoboHelp hadn't added the extra and unique stuff when it converted the project.

Also, I don't seem to have the same options as you do. I'm sure I could use wildcards if I could figure out how to apply them in this instance.

Thanks,

Beth

Captiv8r
Legend
April 17, 2017

The dialog appears different because I displayed the Find tab and it's different than the Replace tab.