19 Replies Latest reply: Feb 27, 2014 9:14 PM by Amit Agarwal RSS

    RH10 Corrupts Bookmark Links on Drop-down Text Link

    Flaven Community Member

      I've noticed that when upgrading RH9 projects to RH10, that RH10 will corrupt (e.g., "Broken Link") all bookmarks set on a drop-down text link. For example, I have a head "Changing the Status in PowerFlow" which when clicked, drops-down a chunk of text. The head is also included as a bookmark, "Changing_the_Status_in_PowerFlow".

       

      These all worked perfectly in RH9 and I've tested the upgrade to RH10 multiple times with the exact same outcome. Bookmarks not associated with drop-down text are unaffected. Note the three MM-4000 broken links, which are associated with drop-downs; there is a fourth bookmark, not associated with a drop-down link, that is accessible:

       

      Broken Links.jpgBroken Links 2.jpg

      RH10 inserts a "#" into the bookmark link, producing a "The filename is invalid. The "#" character cannot be used in a path." error. The bookmarks no longer show up in Project Files, but do show on the topic page (with highlighting) and in the bookmark dialog, but the bookmark on the page does not get selected -- as normal -- in the bookmark dialog.

       

      When compiled as a WebHelp project, the bookmarks work as expected. I'm not sure what the correct syntax is for a legit bookmark, and searching for "#Changing..." and deleting the "#" removes the selection from the Broken Links list, but changes no other behavior.

       

      If anyone has any other fixit ideas, I'd be appreciative: I have hundreds of these throughout multiple projects. Thanks...

        • 1. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
          Peter Grainge CommunityMVP

          Ross

           

          I just created a dropdown in a Rh9 project and bookmarked it. In another topic I created a link to the bookmark and tested it. It worked as expected.

           

          Then I upgraded the project to Rh10 and it still worked.

           

          Are you able to create a new project in Rh9 and test the upgrade with that?

           


          See www.grainge.org for RoboHelp and Authoring tips

           

           

          @petergrainge

          • 2. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
            Flaven Community Member

            Thanks, Peter. New bookmarks of this sort in RH10 work as expected. I uninstalled RH9 and am only working in RH10 at this point--for whatever reason, every single project I had previously created (or upgraded to) in RH9 express this odd behavior, so it may be a carryover from RH7 to RH8 to Rh9...you get the drift. Since the bookmarks work, despite the Broken Link report, I'm leaving well enough alone at this point. If others experience a similar oddity, then it may be worth follow-up--since it's just me at this point...

            • 3. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
              Peter Grainge CommunityMVP

              If you're happy with it, I'm happy. Will keep this in mind if anyone else posts.

               


              See www.grainge.org for RoboHelp and Authoring tips

               

               

              @petergrainge

              • 4. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                Flaven Community Member

                Thanks, Peter: you're the cat's meow. If it does crop up on someone else, I'll pitch in.

                • 5. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                  Praful_Jain Community Member

                  hi Flaven,

                   

                  Can you please share project so that RoboHelp team can look into the issue, you can upload the project @ acrobat.com and share it with me praful@adobe.com

                  this way the RH team will take a better look at the issue and provide some solution to the community.

                   

                  thanks

                  Praful

                  Adobe RoboHelp team

                  • 6. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                    Flaven Community Member

                    Thank you, Praful. I sent you a zip file via YouSendIt and you should have received a notification by now from YouSendIt that the file is available for download. If you have not received the notification, please check your spam folder (I love telling people to do that...<G>)--or I can send you the download link directly.

                    • 7. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                      Praful_Jain Community Member

                      hi Flaven,

                      I downloaded the project file, and looked at the issue. The issue is very specific, just to let all the other people aware, the issue, if you create a DHTML text (dropdown or expanding), and then on that DHTML text you apply bookmark, then upgrade the project to RH10, the bookmark does not appear.

                       

                      The same is the case if you create a new project in RH10 and add bookmark to DHTML text, then bookmark does not appear in the project mgr pod.

                       

                      I have a fix for this issue, the fix is to run a script which is shared @ https://acrobat.com/#d=iwwPZbRDHT-oJ1gSp6Kc6w

                      you need to follow the following steps

                      • Download the script file.
                      • Open RoboHelp project, click View>pod>script Explorer
                      • in the script explorer, right click and select import and select the downloaded script file.
                      • Take backup of your project where DHTML issue is happening.
                      • Open the project, open the script explorer pod, right click on the new script file and select run.
                      • the script will fix the whole project and all the bookmarks will start working fine.

                       

                      The script is just a workaround, till the time RoboHelp engineering team fixes this issue,

                       

                      thanks

                      Praful Jain

                      Adobe RoboHelp team

                      • 8. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                        Captiv8r CommunityMVP

                        Good job, Praful!

                         

                        Question on this. Does the script only need to be run once? Or will it need to be run repeatedly after a specific set of events?

                         

                        Cheers... Rick

                         

                        Helpful and Handy Links

                        RoboHelp Wish Form/Bug Reporting Form

                        Begin learning RoboHelp HTML 7, 8 or 9 within the day!

                        Adobe Certified RoboHelp HTML Training

                        SorcerStone Blog

                        RoboHelp eBooks

                        • 9. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                          Praful_Jain Community Member

                          Like I said earlier, this is just a workaround not a complete fix, if you are creating bookmarks on DHTML text only then you need to run this script. otherwise bookmarks are working fine, so most of the users will not require this script.

                          Also if you want to add bookmark to DHTML text, better to add bookmark before the start of the text, instead of on the DHTML text, then script is not required.

                          the issue occurs only when bookmark and DHTML text are overlapping.

                           

                          thanks

                          Praful Jain

                          • 10. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                            Flaven Community Member

                            Thank you, Praful: that worked like a charm. I noted no issues running the script and the outcome was perfect.

                            • 11. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                              Praful_Jain Community Member

                              Thanks for the confirmation, I always think Extendscript to be an extension to RoboHelp. We can extend RoboHelp and come up with many new features using extendscript feature.

                               

                              Please mark the forum link as answered so that community can get direct answer to the problem.

                               

                              thanks

                              Praful Jain

                              Adobe RoboHelp Team

                              • 12. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                                Cara Bereck Levy

                                Hi--I am now having this problem. I wanted to download the script, but the link provided does not lead there.

                                Is there an alternate link?

                                Thanks, Cara

                                • 13. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                                  Peter Grainge CommunityMVP

                                  I am on the case.

                                   


                                  See www.grainge.org for RoboHelp and Authoring tips

                                   

                                   

                                  @petergrainge

                                  • 15. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                                    Praful_Jain Community Member

                                    Seems like the script URL has changed a bit due to changes in acrobat.com the new URL is

                                    https://workspaces.acrobat.com/?d=iwwPZbRDHT-oJ1gSp6Kc6w

                                    Please follow the steps provided above in the post to run this script.

                                     

                                    Thanks

                                    Praful Jain

                                    • 16. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                                      Cara Bereck Levy Community Member

                                      Can you hear me cheering over there? Worked like a charm--THANKS!!!

                                       

                                      • 17. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                                        Peter Grainge CommunityMVP

                                         

                                         


                                        See www.grainge.org for RoboHelp and Authoring tips

                                         

                                         

                                        @petergrainge

                                        • 19. Re: RH10 Corrupts Bookmark Links on Drop-down Text Link
                                          Amit Agarwal Adobe Employee

                                          Since workspaces.acrobat.com is retiring soon, placing the (above) refered file here itself:

                                           

                                           

                                          ---------------------------------------------------------

                                           

                                           

                                           

                                          /***************************************************************************************** ******************

                                          * $$FileName                    Fix DHTML bookmark issue in RH10.jsx

                                          *

                                          * $$Description                    In RH10, DHTML text with bookmark information is not coming up fine in project manager pod. this script fixes the issue

                                          *

                                          * Author                              Praful Jain

                                          *

                                          * Copyright (c) 2012 Adobe Systems Incorporated. All Rights Reserved.

                                          ****************************************************************************************** ******************/

                                           

                                           

                                          main();

                                          function main()

                                          {

                                                    //check if the project is open or not

                                                    if(RoboHelp.project != undefined )

                                                    {

                                                  if(IsRoboHelp10())

                                                  {

                                                      DoWork ();

                                                  }

                                                              else

                                                              {

                                                                        alert("This script is written for RH10 users only");

                                                              }

                                                    }

                                                    else

                                                              alert("Open Project and then run the script");

                                          }

                                           

                                           

                                          function msg(szString)

                                          {

                                                    RoboHelp.project.outputMessage (szString);

                                          }

                                           

                                           

                                          function IsRoboHelp10() {

                                              //get the RoboHelp version

                                              var versionString = RoboHelp.version;

                                              var iVersion = parseInt(versionString);

                                              return (iVersion == 10);

                                          }

                                           

                                           

                                          function DoWork()

                                          {

                                                    msg("\nTraversing the project.............\n");

                                                    //parse though every thing and count the words

                                                    var tpMgr = RoboHelp.project.TopicManager;

                                                    var snpMgr = RoboHelp.project.SnippetManager;

                                                    msg("****************Started Traversing Topics now*********************\n");

                                                    TraverseManager(tpMgr,true);

                                                    msg("****************Started Traversing Snippets now*********************\n");

                                                    TraverseManager(snpMgr,false);

                                                    msg("******************************************************************************* *******\n");

                                                    msg("Fixed the whole project\n");

                                          }

                                           

                                           

                                          function TraverseManager(mgr,bTopic)

                                          {

                                                    var nCount = 0;

                                                    for(var index=1;index<=mgr.count;index++)

                                                    {

                                                              //for each item, get the file path

                                                              var file = mgr.item(index);

                                                              var filename;

                                                              if(bTopic)

                                                                        filename = file.filename;

                                                              else

                                                                        filename = file.name + file.extension;

                                                              PatchTopicForDHTMLBookmark(file.path,filename);

                                                    }

                                          }

                                           

                                           

                                          function PatchTopicForDHTMLBookmark(filepath,filename)

                                          {

                                                    msg('Travsersing File '+filename+'\n');

                                              var bBodyFound=false;

                                                    //we need to get token Manager

                                                    var nCount = 0;

                                                    var tknmgr = RoboHelp.getTokenManager (filepath);

                                                    var bSave=false;

                                           

                                                    var token = tknmgr.item(1);

                                                    while (isValidType(token))

                                                    {

                                                  if(token.tokenType == RoboHelp.TokenType.TOKENXMLPI )

                                                  {

                                                                        var strTokenName = token.name;

                                                                        var strTokenLowerCase=strTokenName;

                                                                        strTokenLowerCase = strTokenLowerCase.toLowerCase();

                                                                        if(strTokenLowerCase.search("<?rh-dropspot_start")!=-1 || strTokenLowerCase.search("<?rh-expandspot_start")!=-1)

                                                                        {

                                                                                  var startIndex = strTokenLowerCase.indexOf("name=\"");

                                                                                  if(startIndex!=-1)

                                                                                  {

                                                                                            var endIndex = strTokenLowerCase.indexOf('"',startIndex+6);

                                                                                            if(endIndex!=-1)

                                                                                            {

                                                                                                      var lenBookmark = endIndex - startIndex-6;

                                                                                                      var strBookmarkName=strTokenName.substr(startIndex+6,lenBookmark);

                                                                                                      if(!isEmptyString(strBookmarkName))

                                                                                                      {

                                                                                                                //we need to create a new bookmark before this and delete this name attribute

                                                                                                                var strNewTokenText = strTokenName.substr(0,startIndex);

                                                                                                                strNewTokenText += strTokenName.substr(endIndex+1);

                                                                                                                var strBookmarkHTML = '<a name="'+strBookmarkName+'"></a>'+strNewTokenText;

                                                                                                                token.insertText(strBookmarkHTML,false);

                                                                                                                token.delete();

                                                                                                                bSave = true;

                                                                                                      }

                                                                                            }

                                                                                  }

                                                                        }

                                                  }

                                                              token = token.next;

                                                    }

                                                    if(bSave)

                                                    {

                                                              msg('\t\tFixed DHTML bookmarks in file '+filename+'\n');

                                                              tknmgr.save();

                                                    }

                                                    tknmgr.close();

                                                    return nCount;

                                          }

                                           

                                           

                                          function isValidType(value) {

                                              if (typeof (value) !== 'undefined' && value != null) {

                                                  return true;

                                              }

                                              return false;

                                          }

                                           

                                           

                                          function isEmptyString(szString) {

                                              var bRetVal = true;

                                              if (isValidType(szString)) {

                                                  szString = trim(szString);

                                                  bRetVal = szString.length == 0;

                                              }

                                              return bRetVal;

                                          }

                                           

                                           

                                          function trim(szString) {

                                              return szString.replace(/^\s+|\s+$/g, "");

                                          }

                                           

                                           

                                           

                                           

                                          ---------------------------------------------------------

                                           

                                           

                                          ~Amit Agarwal