Copy link to clipboard
Copied
We recently upgraded to the RoboHelp version 9 and are finding a critical problem within all generated html files. It seems RoboHelp is inserting a new script in every html file which we would like to either modify or remove. The snippet of this script is given below.
Our problem is that we have stored these files in a path that has this token “bc-“ - C:\projects\{705e5340-460b-11e1-b8bc-0800200c9a66}.
We need your help to either modify this token or remove this check from all project files.
SNIPPET:
========
if (window.gbWhTopic)
{
var strUrl = document.location.href;
var bc = 0;
var n = strUrl.toLowerCase().indexOf("bc-");
if(n != -1)
{
document.location.href = strUrl.substring(0, n);
bc = strUrl.substring(n+3);
}
Copy link to clipboard
Copied
Egh?
Token?
What problem is being caused by the code? It is in all of my webhelp and is not causing any problems.
See www.grainge.org for RoboHelp and Authoring tips
Copy link to clipboard
Copied
Thanks for replying. Here is the aftermath of this script.
if this is the directory of the html file -
C:\projects\{705e5340-460b-11e1-b8bc-0800200c9a66}\foo.htm
Then the "bc-" token check redirects browser to a new page -
C:\projects\{705e5340-460b-11e1-b8 where there is nothing.
I don't want any redirection based the fact that the directory name
has a token "bc-". Obviously the script is breaking the complete path
into two parts and returning the first part to the browser.
Copy link to clipboard
Copied
I have never seen that script cause any problems by redirecting.
Open one of the sample project and generate an output. I think you will find it works fine and that it has the same script.
Sorry but I don't know enough about scripting to see how it is doing something different for you. Are you saying it is because the path contains the string bc?
If it is, I don't understand why you have a path that contains 705e5340-460b-11e1-b8bc-0800200c9a66. Maybe if you explain that, it will help us help you. Bear in mind we are not developers.
See www.grainge.org for RoboHelp and Authoring tips
Copy link to clipboard
Copied
Are you saying it is because the path contains the string bc?
Ans- yes "bc-" is the token which is present in the full pathname of
this html file.
Pathnames like these are usually created by those programs which
relies on the uniqueness of UUIDs.
Pathnames containing UUIDs are valid names and accepted by browsers as
well as OS.
Copy link to clipboard
Copied
This type of path is not something I am familiar with. If you have no option but to work this way then you are going to have to take this up with Adobe Technical Support.
All I can say is that in all the time I have followed these forums, this problem has never arisen. If this is a common way of working, it seems odd that the problem has not arisen before.
Sorry I cannot help more.
See www.grainge.org for RoboHelp and Authoring tips
Copy link to clipboard
Copied
Hi,
Peter and I have been looking into this problem and here's what we found:
RH sometimes adds bookmarks in the top of topics called “bc-x” This is done because a topic can be used in the TOC multiple times. But based on the item selected in the TOC, the topic needs display a different breadcrumb path. The script uses a link to the bc-x bookmark to determine which breadcrumb path to show.
When the topic is opened without the skin showing, the script will try to reload the topic by simply removing the link to the bc- bookmark:
http://example.com/myfile.htm#bc-1
becomes:
http://example.com/myfile.htm#
The script doesn't try to redirect when you open the topic with the skin showing, such as: startpage.htm#target.htm#bc-1
Af far as I can make out, I think it will be safe to simple remove the line
document.location.href = strUrl.substring(0, n);
from your output. Although I couldn't find another use for this besides the breadrumbs, I can't say for sure what other impact removing the line may have. You can try removing the line to see whether it works. NOTE: if you find a new issue that surfaces because you removed the line, I doubt that anyone on the forum will be able to help. Sorry, but we are only users like yourself.
Having said that, you can use a find and replace tool such as FAR to quickly remove the above mentioned line from your output files. Alternatively, you can create a script to do that for you.
I think Peter's advice is sound: do take this up with Adobe Technical Support and/or report this as a bug: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform&product=38
Greet,
Willam
Copy link to clipboard
Copied
I must say, admirable job of sleuthing that out, gentlemen! Well done!
Cheers... Rick
Helpful and Handy Links RoboHelp Wish Form/Bug Reporting Form Begin learning RoboHelp HTML 7, 8 or 9 within the day! |