Skip to main content
April 5, 2013
Question

A Find expression to find everything in span tag

  • April 5, 2013
  • 1 reply
  • 3967 views

I imported word doc into my robohelp project and there is a lot of span tag junk i want to get rid of.

Is there an expression i can build in the "find and replace" tool that will find any span tag and its contents?

In the following example I want to delete the whole string including the brackets:

<span style="letter-spacing: .05pt;">

I'm thinking possibly a wildcard like: <span ***>

I don't see a wildcard option in robohelp help related to building find expressions.

This topic has been closed for replies.

1 reply

Willam van Weelden
Inspiring
April 5, 2013

Hi,

Are you using RoboHelp 8 or above? If so, you can use a script for that. (I have one lying around somewhere, let me know if you're interested.)

If you want to search, don't search for <span, as that will remove span tags you want to retain (styles, expandtexts, etc.) I'm not very comfortable with regular expressions, but Peter might know a fancy regex.

@Peter: Hello! Can you chime in?

Greet,

Willam

Peter Grainge
Community Expert
Community Expert
April 5, 2013

Nasty one this as you cannot search for <span - and all between - and </span> without trashing a lot of stuff that is needed.

In theory if you have Rh10 you could add a must include but there are two issues there. It sounds like there could be many must includes and there is a bug in the Must Include part of the new Find and Replace in Files so you don't want to use it anyway.

I'm thinking you want to avoid those tags in the first place. It sounds like the source document has inline formatting that needs to be removed.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
Peter Grainge
Community Expert
Community Expert
April 6, 2013

I am using tech com suite 10. I don't mind using an expression that could delete any span tag and its values because i can do "find next" to keep what i need.

I would have preferred not importing the word doc and all its span tag formatting, but i needed a detailed table that i did not want to reproduce from scratch --so i traded one problem for another one.

William, thank you for the offer of a script.  are there any instructions for using it? i'm not familiar with running scripts in robohelp. i would like to look at it. maybe i can figure it out.

Peter, i am hoping for an "and everything in between" like a wildcard because there are variations in various span tag values i want to get rid of.

How 'bout another alternative: how can i get a table from word to robohelp where all i want to retain is column/row structure and each cell's text content? --without text formatting?

Also, how 'bout a 3rd party html editor that enables me to build this type of expression. I also have dreamweaver CS6.


Tools that handle regular expressions are not the problem, it's writing the expression that requires the time and skill.

If you are just looking for everything starting <span and ending </span> you don't need regular expressions, I think Rh's Find and Replace in Files will do it, just don't use the Must Include field and make sure you have a backup of your project.

Now that we know your version of Rh, apply a style to your tables in Word (create a named style if you have to) and create a table style in Rh. When you import you can map the two and then the table should be good.

Importing is covered on my site and I think mapping tables is in the Rh9 section of my RoboHelp Tour.


See www.grainge.org for RoboHelp and Authoring tips

@petergrainge

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.