• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

RH's HTML Editor Changing < to <

Enthusiast ,
Aug 17, 2009 Aug 17, 2009

Copy link to clipboard

Copied

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

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 18, 2009 Aug 18, 2009

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>

Votes

Translate

Translate
LEGEND ,
Aug 17, 2009 Aug 17, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 18, 2009 Aug 18, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 18, 2009 Aug 18, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Aug 18, 2009 Aug 18, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 18, 2009 Aug 18, 2009

Copy link to clipboard

Copied

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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 19, 2009 Aug 19, 2009

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Aug 18, 2009 Aug 18, 2009

Copy link to clipboard

Copied

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...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp