Highlighted

Tags broken across lines

Community Beginner ,
Feb 09, 2015

Copy link to clipboard

Copied

Robohelp HTML 11.

Rh is breaking strings into lines. The <p> below is actually broken into 3 lines, in this file, lines 69, 70, and 71.
While this does not adversely affect the outputs, it makes Find and Replace in Files nearly useless.

Say I want to delete every occurrence of the image tag seen in the code below. I can't because sometimes the line break could be anywhere in that tag, so my universal search finds no match.

<img
src="Plus_Button.jpg" alt=""
style="border: none;" border="0" />


Any ideas?

Adobe Community Professional
Correct answer by Amebr | Adobe Community Professional

I don't believe you can change Robohelp's behaviour, but you can use regular expressions to find the text.

For your example, if you don't know regular expressions, the easiest way to achieve it would be to copy the code into a text editor so you can remove the line breaks and replace all the spaces with \s*. This means "find zero or more white space characters". White space includes spaces, carriage returns, line feeds, etc. This is basic and won't find examples with any variations (e.g. different border size) but will let you find specific examples where the main hurdle is the extra spacing and line breaks.

So you'd end up with:

<img\s*src="Plus_Button.jpg"\s*alt=""\s*style="border:\s*none;"\s*border="0"\s*/>

NOTE: Make sure you take a backup before you run any Replace All actions and check multiple affected topics to make sure nothing untoward has happened.

Paste the resulting text into the Find box and make sure the Use checkbox is ticked and Regular Expression is selected. You might have to click the Show Options icon to see this option.

If you want greater control, TextCrawler is a great app, and has a nifty test function where you can paste in several examples while you work on your regular expression, to make sure you are finding all correct instances before you (accidentally) run the script on your production project ( ).

HTH.

Topics

HTML

Views

184

Likes

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

Tags broken across lines

Community Beginner ,
Feb 09, 2015

Copy link to clipboard

Copied

Robohelp HTML 11.

Rh is breaking strings into lines. The <p> below is actually broken into 3 lines, in this file, lines 69, 70, and 71.
While this does not adversely affect the outputs, it makes Find and Replace in Files nearly useless.

Say I want to delete every occurrence of the image tag seen in the code below. I can't because sometimes the line break could be anywhere in that tag, so my universal search finds no match.

<img
src="Plus_Button.jpg" alt=""
style="border: none;" border="0" />


Any ideas?

Adobe Community Professional
Correct answer by Amebr | Adobe Community Professional

I don't believe you can change Robohelp's behaviour, but you can use regular expressions to find the text.

For your example, if you don't know regular expressions, the easiest way to achieve it would be to copy the code into a text editor so you can remove the line breaks and replace all the spaces with \s*. This means "find zero or more white space characters". White space includes spaces, carriage returns, line feeds, etc. This is basic and won't find examples with any variations (e.g. different border size) but will let you find specific examples where the main hurdle is the extra spacing and line breaks.

So you'd end up with:

<img\s*src="Plus_Button.jpg"\s*alt=""\s*style="border:\s*none;"\s*border="0"\s*/>

NOTE: Make sure you take a backup before you run any Replace All actions and check multiple affected topics to make sure nothing untoward has happened.

Paste the resulting text into the Find box and make sure the Use checkbox is ticked and Regular Expression is selected. You might have to click the Show Options icon to see this option.

If you want greater control, TextCrawler is a great app, and has a nifty test function where you can paste in several examples while you work on your regular expression, to make sure you are finding all correct instances before you (accidentally) run the script on your production project ( ).

HTH.

Topics

HTML

Views

185

Likes

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
Adobe Community Professional ,
Feb 09, 2015

Copy link to clipboard

Copied

I don't believe you can change Robohelp's behaviour, but you can use regular expressions to find the text.

For your example, if you don't know regular expressions, the easiest way to achieve it would be to copy the code into a text editor so you can remove the line breaks and replace all the spaces with \s*. This means "find zero or more white space characters". White space includes spaces, carriage returns, line feeds, etc. This is basic and won't find examples with any variations (e.g. different border size) but will let you find specific examples where the main hurdle is the extra spacing and line breaks.

So you'd end up with:

<img\s*src="Plus_Button.jpg"\s*alt=""\s*style="border:\s*none;"\s*border="0"\s*/>

NOTE: Make sure you take a backup before you run any Replace All actions and check multiple affected topics to make sure nothing untoward has happened.

Paste the resulting text into the Find box and make sure the Use checkbox is ticked and Regular Expression is selected. You might have to click the Show Options icon to see this option.

If you want greater control, TextCrawler is a great app, and has a nifty test function where you can paste in several examples while you work on your regular expression, to make sure you are finding all correct instances before you (accidentally) run the script on your production project ( ).

HTH.

Likes

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
Reply
Loading...
LEGEND ,
Feb 10, 2015

Copy link to clipboard

Copied

Rh breaks up the html. Since whitepace is ignored in HTML, this is not a problem.

In addition to Amber's suggestions, you can also use scripting to parse the topics. In that case you don't need to worry about the line breaks at all. (The same warning applies to scripting: make a backup.)

Likes

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
Reply
Loading...
NealonUX LATEST
Community Beginner ,
Feb 11, 2015

Copy link to clipboard

Copied

Thanks, William. I'll see how it goes. I could tell that the white-space breaks weren't harming the output; they were just making searches inconvenient with the tools I was using. I wonder why RoboHelp makes those breaks.

Likes

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
Reply
Loading...
Community Beginner ,
Feb 11, 2015

Copy link to clipboard

Copied

Thanks, Amebr! I'll try it. I've used regular expressions in the past, but haven't become proficient. This will be a good learning exercise--on sandbox copies of the documents! I'll let you know how it turns out.

Likes

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