7 Replies Latest reply on Aug 19, 2009 9:38 AM by JaredHess

    RH's HTML Editor Changing < to &lt;

    JaredHess Level 1

      I typed this code to call a Javascript from one of two possible locations:

       

      <script
      src="feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"
      </script>

      <script
      src="../feedback_script.js" language=javascript type="text/javascript"
      style="x-condition: Online;"</script>

       

      However on the first call, RH changes it to the following once I click out of HTML or navigate away from the topic:

      <script
      src="feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"
      &lt;/script>

      <script
      src="../feedback_script.js" language=javascript type="text/javascript"
      style="x-condition: Online;"</script>

       

      Notice that the closing tag, </script>, has been replaced as &lt;/script>.

       

      This breaks the calling statement. Anywone know why RH is doing this and how to make my code "stick"?

       

      Thanks,

       

      Jared Hess

      RH 7.0.3.001

      Win32 Vista

      HTMl Help Output

        • 1. Re: RH's HTML Editor Changing < to &lt;
          Willam van Weelden Adobe Community Professional & MVP

          Hi,

           

          Embed all tags in < and >. RoboHelp replaces the second <, because it wants to close thet <script tag. You code should work if you use it as following:

           

          <script>
          src="feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"
          </script>

          <script>
          src="../feedback_script.js" language=javascript type="text/javascript"
          style="x-condition: Online;"

          </script>

           

          Greets,

           

          Willam

          • 2. Re: RH's HTML Editor Changing < to &lt;
            Amebr Level 4

            I don't think that will work, as src, type, etc are attributes of the script tag, not the script code itself, and must be within the opening script tag.

             

            However, I did find a page that says script doesn't support standard attributes, such as lang and style. So you might try removing those attributes and see if RH still plays with the brackets. Alos, possibly putting the type earlier might help (it shouldn't make a difference, but sometimes these things do).

             

            http://www.w3schools.com/TAGS/tag_script.asp

             

            Amebr

            • 3. Re: RH's HTML Editor Changing < to &lt;
              Willam van Weelden Adobe Community Professional & MVP

              Ahh, my bad... Didn't pay enough attention, it should be like this:

               

              <script  src="feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"></script>

              <script  src="../feedback_script.js" language=javascript type="text/javascript"  style="x-condition: Online;"></script>

               

              I'n not sure about the style attribute though, but it probably won't do any harm.

               

              Greet,

               

              Willam

              • 4. Re: RH's HTML Editor Changing < to &lt;
                MergeThis Level 4

                JavaScript tends to balk at tabs and line breaks that are in the code, which is usually inherent when you copy the script that has some word wrapping and tabs in it. Those breaks, unfortunately, are interpreted as such when you paste it into your topic's html code.

                 

                It's always best to "scrub" the code thru Notepad. That is:

                 

                1. Paste the script into Notepad.
                2. In Notepad, Format menu, turn off Word Wrap.
                3. In Notepad, ensure that all the script is on a single line (work from the beginning of the last line and hit the Backspace key to clear backwards so that only a single space appears between statements (no tabs or line breaks), then continue for each remaining line.
                4. In Notepad, select that line and copy it.
                5. In RH HTML code, paste the script, and Save.

                 

                Note that RH will turn that script into "human-readable" code (maybe identical to what you started with in step 1) with tabs and line breaks, but that's OK. Since it "knows" about those breaks, it will "read" that JavaScript code correctly.

                 

                Good luck,

                Leon

                • 5. Re: RH's HTML Editor Changing < to &lt;
                  JaredHess Level 1

                  Thanks everyone for your help. I tried MergeThis's suggestion, but that didn't work either... at least the < kept changing.

                   

                  After some more testing, seems that if I use the Insert | HTML | Advanced | Script menu item and use the dialog box to insert the script it keeps the < symbol intact. Wish I could just use the HTML Editor like an editor and just paste and type my HTML like I desired w/o RH messing with it. But oh well guess you can't have your cake and eat it too...

                  • 6. Re: RH's HTML Editor Changing < to &lt;
                    Amebr Level 4

                    Oh, I missed it the first time too. I've coloured and bolded the missing part of the tag as per William's post. I tried it in RH6 and RH7 and the code isn't changed when the missing bracket is included.

                     

                    <script  src="feedback_script.js" language=javascript type="text/javascript" style="x-condition: Online;"></script>

                    <script  src="../feedback_script.js" language=javascript type="text/javascript"  style="x-condition: Online;"></script>

                    • 7. Re: RH's HTML Editor Changing < to &lt;
                      JaredHess Level 1

                      Thanks Amebr. I suppose I was missing the closing right angle brackets > there. I didn't notice them until you pointed it out... I was wondering what everyone else was talking about... Blind as a bat I suppose. So chalk this one up to user error then. It certainly won't be the first time (or the last unfortunately).

                       

                      Jared