Missing space in imported Word topics

This forum is for all Flare issues related to importing files or projects.
Post Reply
Ken Billing
Propeller Head
Posts: 55
Joined: Mon Dec 17, 2007 11:33 am

Missing space in imported Word topics

Post by Ken Billing »

Here's the scenario:
  • One or more words preceeding an image (icon) have a Word style applied to them that is mapped to a Flare span style upon import
    There is a space between the words and the image that is selected by Word when the text was selected for styling.
    Flare strips the (trailing) space in the span tag during import
    The output results in no space between the words and the image
Anybody else encounter this and find a solution other than "don't select the trailing space?"

Thanks!
Ken Billing | Technical Writer
BlueCielo ECM Solutions
http://www.bluecieloecm.com

Image
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Missing space in imported Word topics

Post by KevinDAmery »

Flare has an ongoing issue with spaces that appear between two sets of tags, so my guess is it's ignoring the space between </img> and </span> or something to that effect.

You could probably solve it using a find and replace with the "find in source code" and "whole project" options selected.

Find:
<img "your image location here" /> </span>

Replace:

<img "your image location here" /> </span>
Until next time....
Image
Kevin Amery
Certified MAD for Flare
Ken Billing
Propeller Head
Posts: 55
Joined: Mon Dec 17, 2007 11:33 am

Re: Missing space in imported Word topics

Post by Ken Billing »

That would be a solution if the spaces made it into the topic files, but they don't:

Before import in MS Word (note the space inside the span tags)
<char style start>Some text here <char style end><Image here>

After import into Flare (space removed from between the span tags)
</span>Some text here</span><img>Image here</img>

I suppose I could S&R:
</span><img>

with
</span> <img>

but I'd prefer not to add yet another step to my process, if possible.

Thanks.
Ken Billing | Technical Writer
BlueCielo ECM Solutions
http://www.bluecieloecm.com

Image
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Missing space in imported Word topics

Post by KevinDAmery »

Agreed, but I'm not sure what else to suggest.

You could modify the image to have some additional white space to the right side, but that would only be feasible if you only use that image as a leader for text.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Missing space in imported Word topics

Post by LTinker68 »

What about adding a padding-right property to the img tag in the stylesheet instead?
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Ken Billing
Propeller Head
Posts: 55
Joined: Mon Dec 17, 2007 11:33 am

Re: Missing space in imported Word topics

Post by Ken Billing »

Good ideas, but then the padding would apply to all images, not just the inline images, and could adversely affect alignment in other places. I'll probably write a Word macro to find all such inline images and replace any neighboring spaces with non-breaking spaces, which Flare respects.

Can anybody explain the reasoning behind Flare stripping all such spaces? Is it an HTML spec? The conventional wisdom is "garbage in, garbage out." When apps try to outsmart users and implement "garbage in, golden out," there are invariably exceptions such as this one.
Ken Billing | Technical Writer
BlueCielo ECM Solutions
http://www.bluecieloecm.com

Image
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Missing space in imported Word topics

Post by LTinker68 »

Ken Billing wrote:Good ideas, but then the padding would apply to all images, not just the inline images, and could adversely affect alignment in other places.
So do it the other way. Set up a complex selector that says if a span follows an img tag then apply padding-right to the img tag. Create another one for the opposite -- if an img tag follows a span tag then apply a padding-right to the span tag. So the padding-right values are only added to the img and span tags if they're immediately followed by the other tag. I think there's a complex selector for that, although I might be thinking of one where one tag is completely enclosed by another tag, which wouldn't be the situation in your case. You might have to do some research on that.

As for why Flare does that, I'm assuming it's to get rid of extra spaces since HTML/XHTML doesn't support extra spaces unless they're inserted using the non-breaking space code. You'd think that if there were a couple of spaces next to each other in the source document then it would leave at least one space behind after the import, but I'm not a programmer, so I don't know if that's doable or not.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
ophil
Jr. Propeller Head
Posts: 4
Joined: Thu Mar 29, 2007 12:39 am

Re: Missing space in imported Word topics

Post by ophil »

I'm trying to use the new Flare v4, and I have the same problem.

The Flare v4 omits the null new-lines in MS Word files. Not just the img related tags.

In Flare v3, the result is:
<p class="Word_Style_1">aaaaa</p>
<p class="Word_Style_1"> </p>
<p class="Word_Style_1">bbbbb</p>
And this is the same structure as I can see in the ms word.

But in Flare v4, the result is:
<p class="Word_Style_1">aaaaa</p>
<p class="Word_Style_1">bbbbb</p>

Is this a new feature or a bug in Flare v4 ?
Post Reply