Cleaning up useless spans

This forum is for all Flare issues not related to any of the other categories.
Post Reply
jmenning
Propeller Head
Posts: 50
Joined: Thu Jul 20, 2006 2:52 pm

Cleaning up useless spans

Post by jmenning »

I have a project that came from Robohelp, originally, and was in Flare for about 6 months before I took it over. I've been working on cleaning it up, including what was effectively a rewrite of the style sheet. Some of the changes I made remove the need to use spans to apply formatting to specific chunks of text. That means that I now have a lot of spans that do absolutely nothing (because the class they refer to does not exist in the style sheet).

It's not a huge deal (it doesn't, after all, break the output), but I hate it, so I want to use Analyzer to get rid of them (mass delete). However, Analyzer will delete the class and leave the span tag. So, instead of a span with a class that does nothing, I have a span with no properties. If I just delete the <span> tag, Flare starts throwing out errors because it's not proper markup.

In Find and Replace, I can search for <span>*</span> to find this, but I can't figure out how to do the replace. (* just enters * in place of the original text)

Does anyone know a way to automate removing these tags without deleting the content between them?
Alice
Propeller Head
Posts: 31
Joined: Wed Dec 31, 2008 4:58 am
Location: Belarus

Re: Cleaning up useless spans

Post by Alice »

You can make use of regular expressions, but in this case you'll have to use an outside programme like FER HTML for example, because Flare doesn't seem to support proper replacement and i don't know about Analyzer
Alice
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Cleaning up useless spans

Post by NorthEast »

Do you want to get rid of all spans, or just spans of a particular class?

If you want to get rid of all spans, just search for the opening tags <span> (or <span class=xxx">) and replace it with nothing, then do the same the closing span tags </span>.

If you want to remove spans of a particular class, then that'll require an intelligent search and replace to remove only the matching pairs, as Alice suggested (it's easy enough in FAR HTML).
jmenning
Propeller Head
Posts: 50
Joined: Thu Jul 20, 2006 2:52 pm

Re: Cleaning up useless spans

Post by jmenning »

Thanks.

Since I don't want to remove all spans, I guess I'll take a look at FAR HTML.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Cleaning up useless spans

Post by NorthEast »

Look at the 'Advanced find and replace', you'd use something like:

Starting with: <span class="xxx">
Ending with: </span>
Replace: $O-$ (this removes the start and end)
jmenning
Propeller Head
Posts: 50
Joined: Thu Jul 20, 2006 2:52 pm

Re: Cleaning up useless spans

Post by jmenning »

Beautiful! I love it.

Why on earth didn't I find this program years ago? :D

Thanks!
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Cleaning up useless spans

Post by NorthEast »

Great. FAR is pretty handy, I've used it a lot to clean up imported projects.
Post Reply