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

Code Snippets?

New Here ,
Feb 19, 2009 Feb 19, 2009

Copy link to clipboard

Copied

Similar question regarding XML code snippets in RH5 HTML Help topics: cutting and pasting from compiled help (or from source files) into any text editor....sometimes in the <codesample>, RH has (without rhyme or reason) added kadov "stuff" for some of the &nbsp (but not others). I think these "ghosts" cause havoc when cutting and pasting snippets from compiled help (it's worse if I do it from the raw topic)--the only thing I can figure is that kadov characters don't display, but they do cause problems with any text editor (Notepad, Wordpad, UltraEdit).

Does anyone have a solution for making code samples copy friendly? Is there a script that I can include so readers can click a button/hyperlink to copy/save code sample without any artifacts? The solution has to work on multiple browsers.

Views

289

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 ,
Feb 20, 2009 Feb 20, 2009

Copy link to clipboard

Copied

Insert a text box and put the code in that.

See this article on my site and note how I use a text box for this purpose. The ability for the user to click inside the text box and have the code highlighted needs a small tweak to the code. User View Source when viewing my article and you will see the bit of code you need to add. Come back if stuck.

http://www.grainge.org/pages/authoring/twisty/twisty.htm

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.

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 ,
Feb 20, 2009 Feb 20, 2009

Copy link to clipboard

Copied

LATEST
You need to add this to the code RH creates.

onFocus="select()"

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.

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