17 Replies Latest reply on Oct 24, 2008 11:54 AM by Alan_Davidson

    Some spacing dropped w/ Highlight enabled

    hurdl1
      Wondering if anyone else has encountered this. I'm seeing it in output from RH HTML 7. Note: I do not generate Help with a skin.

      1. Generate WebHelp w/ any preferred format (I usually use DHTML > Java Applet > Pure HTML).
      2. Select Search tab in Help and search for any string with 'Highlight search results' check box selected.
      3. View a topic that contains search hits. Spaces are missing around some (not all) hyperlinked or formatted (e.g., bolded) text in the topic.

      The only 'fix' for this I can find is to insert hard spaces in the HTML around all hyperlinked and formatted text. Surely there must be a better way....

      Thanks in advance for any ideas.
        • 1. Re: Some spacing dropped w/ Highlight enabled
          MergeThis Level 4
          If "Spaces are missing around some (not all) hyperlinked or formatted (e.g., bolded) text in the topic," it's probably because those spaces are included, or not, within the SPAN tags that determine the formatting.


          Good luck,
          Leon
          • 2. Re: Some spacing dropped w/ Highlight enabled
            Ejung
            We're experiencing the same problem.
            1. First, we generate WebHelp with the Highlight Search Result option enabled.
            2. Perform a Search.
            3. Click on a topic.
            Look for the highlighted word. The word after the highlighted word will have a missing space. This occurs only if the highlighted word is formatted (italicized or bolded)
            3. Go to the TOC and click on a different topic.
            4. Click on the same topic (as in Step 3).
            Notice that the highlight is removed (since we are not performing a search) and the missing space is back.
            We are able to reproduce this with every project, with or without a skin and in IE (not in Firefox. That's a first!)
            • 3. Re: Some spacing dropped w/ Highlight enabled
              vivek_k-GfmzA1 Level 1
              This is a bug and we missed fixing it in 7.0.2 patch. I am pasting the fix below, you will have to modify the file "C:\Program Files\Adobe\Adobe RoboHelp 8\RoboHTML\WebHelp5Ext\template_stock\whtopic.js" manually if you wish you take up the fix.

              Look for funciton
              this.doHighlight = function( a_aRanges, a_nStart )

              and replace the entire function body with

              this.doHighlight = function( a_aRanges, a_nStart )
              {
              s_strHlStart = "<font style='color:" + gsTextColor + "; background-color:" + gsBkgndColor + "'>";
              s_strHlEnd = "</font>";

              if ( a_nStart >= a_aRanges.length )
              return a_nStart;

              var nEnd = this.getClosedRanges( a_aRanges, a_nStart );
              if ( this.aClosedRanges.length == 0 )
              return nEnd;
              var strText = this.node.data;
              var strHTML = "";
              var nLastStart = 0;
              for ( var i = 0; i < this.aClosedRanges.length; i++ )
              {
              strHTML += strText.substring( nLastStart, this.aClosedRanges .nStart - this.nFrom );
              strHTML += s_strHlStart;
              strHTML += strText.substring( this.aClosedRanges
              .nStart - this.nFrom,
              this.aClosedRanges .nEnd - this.nFrom );
              strHTML += s_strHlEnd;

              nLastStart = this.aClosedRanges
              .nEnd - this.nFrom;
              }
              strHTML += strText.substr( nLastStart );

              var spanElement = document.createElement( "span" );
              spanElement.innerHTML = strHTML;
              if (gbIE4)
              {
              //for IE, when assigning string to innerHTML, leading whitespaces are dropped
              if ((strHTML.length >0)&&(strHTML.charAt(0) == " "))
              spanElement.innerHTML = " " + spanElement.innerHTML ;
              }
              this.node.parentNode.replaceChild( spanElement, this.node );
              if(gnYPos == -1)
              {
              var elemObj = spanElement;
              var curtop = 0;
              if (elemObj.offsetParent)
              {
              while (elemObj.offsetParent)
              {
              curtop += elemObj.offsetTop
              elemObj = elemObj.offsetParent;
              }
              }
              else if (elemObj.y)
              curtop += elemObj.y;

              gnYPos = curtop;
              }
              return nEnd;
              };

              Notice that only following 6 new lines have been added in the modificaiton

              if (gbIE4)
              {
              //for IE, when assigning string to innerHTML, leading whitespaces are dropped
              if ((strHTML.length >0)&&(strHTML.charAt(0) == " "))
              spanElement.innerHTML = " " + spanElement.innerHTML ;
              }

              thanks
              Vivek
              RoboHelp Team.
              Adobe Systems.
              • 4. Re: Some spacing dropped w/ Highlight enabled
                Peter Grainge Adobe Community Professional (Moderator)
                You can download a replacement file from my site.

                http://www.grainge.org/pages/authoring/rh7/using_rh7.htm

                See item 32.

                • 6. Re: Some spacing dropped w/ Highlight enabled
                  KC in Colorado Level 1
                  I was so excited to find this patch because I'm having a similar problem. Generating FlashHelp with RH7, if I search on 2 words with highlight turned on, they appear fine. But if I add a third word (client error log, for example), the space is missing between the second and third word in the highlighted text. It appears as "client errorlog".

                  I downloaded the updated whtopic.js from Peter's site (thanks, Peter) and put it in the WebHelp5Ext\template_stock folder (renamed the old one to old_whtopic.js first), and regenerated my FlashHelp, but the result was the same. Then I copied the updated .js file to the template_stock folder under WildFireExt (because I seem to remember putting other FlashHelp fixes there years ago) but that didn't fix the problem either. What am I missing? -- kc
                  • 7. Re: Some spacing dropped w/ Highlight enabled
                    HKabaker Level 2
                    kc,

                    Did you flush your browser disk cache in between?

                    Harvey
                    • 8. Re: Some spacing dropped w/ Highlight enabled
                      HKabaker Level 2
                      kc,

                      Another point:

                      The RH Search function does not accommodate phrases. This is specifically noted in the RH help topic. Maybe this is irrelevant to the disappearing space issue, but what happens if you enter "client and error and log"?

                      H
                      • 9. Re: Some spacing dropped w/ Highlight enabled
                        KC in Colorado Level 1
                        Thanks for replying, Harvey. As it turns out, this appears to be happening because I have an inline style applied within a Heading 1 and the highlighting feature doesn't handle the <span> tags properly.

                        In all my Heading 1's for topics describing dialog boxes and tabs, the name of the item had a different color from the nouns that follow. The color was applied as in inline style (selected words in the Heading 1 text and applied a different color font).

                        For example, in a topic whose Heaing 1 was Client Information dialog box, the words "Client" and "Information" were gold, matching the dialog box title bar. If you searched on client information dialog, the space between information and dialog box was removed in highlighted text. But if the inline style is removed, the space correctly appears in highlighted text.

                        Here's an example of the a Heading 1 with an inline style applied.

                        <h1><span style="color: #ffa54f;"><img src="circles_agentGUI.jpg" x-maintain-ratio=TRUE style="border: none; margin-left: 0px; margin-right: 6px; margin-top: 0px; margin-bottom: 3px; width: 73px; height: 49px; border-style: none; float: left; border-style: none; float: left;" width=73 height=49 align=left border=0>Client Information</span> dialog box</h1>

                        To work around this problem, I created a new Head1 style that applies the different color to the entire heading. That eliminates the extra <span> tags and the highlighted text appears correctly.

                        Still think the Robo code should allow for the <spans> but the workaround will work for us.


                        kc
                        • 10. Re: Some spacing dropped w/ Highlight enabled
                          HKabaker Level 2
                          Good sleuthing!
                          • 11. Re: Some spacing dropped w/ Highlight enabled
                            MergeThis Level 4
                            Indeed, Holmes!
                            • 12. Re: Some spacing dropped w/ Highlight enabled
                              KC in Colorado Level 1
                              Well, I guess I spoke too soon. I'm still having issues with the highlighted search results. If the word preceding the highlighted text is bold, the space is missing after the bold text. But it's there in the Robo editor, and preview, and in HTML. The HTML looks like this:

                              <li class=p><p>Click <span style="font-weight: bold;">Backups</span>
                              in the left pane of the <b>STORServer Agent Settings</b> dialog box.</p></li>

                              The missing space in the FlashHelp output is the space after Settings when you search on "dialog box" or just "dialog."

                              Suggestions, ideas? -- kc
                              • 14. Re: Some spacing dropped w/ Highlight enabled
                                KC in Colorado Level 1
                                I am already using the updated js file, which I downloaded from your site (item 32) before I posted previous messages. :*( -- kc
                                • 15. Re: Some spacing dropped w/ Highlight enabled
                                  Peter Grainge Adobe Community Professional (Moderator)
                                  I can only suggest you report this as a bug adding that you have already tried the updated JS file supplied by Adobe. Sorry.

                                  http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

                                  • 16. Re: Some spacing dropped w/ Highlight enabled
                                    KC in Colorado Level 1
                                    Done. Thanks for the link, Peter. -- kc
                                    • 17. Re: Some spacing dropped w/ Highlight enabled
                                      Alan_Davidson
                                      I'm having a similar problem, but in my case entire words are missing when I enable the Highlight toggle. I updated my version of RoboHelp to the latest version and also installed the JS file that Peter provided. I have attached an example of the problem I'm talking about (I hope that works).

                                      Any ideas as to what's going on here? And thanks for any help.

                                      -Al