Non-breaking space failure

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.

Non-breaking space failure

Postby Techno on Fri Sep 20, 2019 9:52 am

I seem to have stumbled into an odd case where non-breaking spaces are "breaking".
It is the accepted norm when authoring internationally distributed manuals, to add a zero in brackets as shown below in telephone numbers.

+44 (0)123 456 7890

However, regardless of what type of bracket is used - round, square or curly - we always get a new line occurring immediately after the non-breaking space following the +44.

Does anyone know if there is a work around, or if it is a bug?

For what it is worth, we have found that the only way to retain non-breaking spaces in Variables, is to create the text in a Topic, and then copy and paste into the display part of the Variable, e.g. "Canute 360". There does not appear to be any other way to add a space. However even that fails with the above issue.
George Bell
Techno-Vision Systems Ltd., U.K.
Techno
Sr. Propeller Head
 
Posts: 181
Joined: Fri Dec 09, 2005 9:23 pm
Location: NORTHAMPTON, England, UK

Re: Non-breaking space failure

Postby Chicago_HPT on Fri Sep 20, 2019 10:59 am

Are you trying to add the non-breaking space in the topic text or in a variable?

One possible reason for the problem could be that browsers, particularly IE, tend to break on punctuation, such as the opening parenthesis in "(0)." One option could be to wrap the phone number (or the troublesome part of the phone number) in a new span style that prevents word-wrapping, such as
Code: Select all
.phone-number{
    white-space: nowrap;
}

So, your HTML would look like this:
Code: Select all
<p>Some text that precedes a phone number: <span class="phone-number">+44 (0)123 456 7890</span> Other text that follows the phone number.</p>

This should prevent any text within the span tags from wrapping inside the phone number. If you don't want to prevent the entire phone number from wrapping then only put the span tags around the part you want to keep together.

You can see discussion about this topic in this Stack Overflow article. And for more information about word wrapping and line breaks in browsers, here's an article that might help. It's six years old, though, so some information may need further verification.

I hope that helps.

Cheers,
-jeff
Chicago_HPT
Propeller Head
 
Posts: 77
Joined: Sun Feb 03, 2013 6:01 pm

Re: Non-breaking space failure

Postby Chicago_HPT on Fri Sep 20, 2019 11:08 am

D'oh! I just noticed you posted your question under Printed Documentation Targets. It's possible the target format (e.g. Word, PDF, etc.) treats word-wrapping similar to browsers, and so presents the same issue. Hopefully, the solution works for both web and print.

-jeff
Chicago_HPT
Propeller Head
 
Posts: 77
Joined: Sun Feb 03, 2013 6:01 pm

Re: Non-breaking space failure

Postby Techno on Fri Sep 20, 2019 3:21 pm

Hi Jeff, to be honest I wasn't quite sure where to post it, but suffice to say that I was in Flare, in a Topic, and in Print view of that Topic. So it's not a Word issue.

My test might have been crude, but essentially was to type some "normal" text, and then the telephone number making sure I inserted non-breaking space where required via Flare's own insert function.

I then simply went to be beginning of the line and typed text pushing the phone number over until it reached the right hand side of the page, where the number "should" have moved in it's entirety to the next line.

Leave the brackets out, and all is well. But that's now how we Brits display phone numbers.

As regards adding non-breaking spaces in Variables, the only way I have been able to do this is, is I described in my original message.

- George
George Bell
Techno-Vision Systems Ltd., U.K.
Techno
Sr. Propeller Head
 
Posts: 181
Joined: Fri Dec 09, 2005 9:23 pm
Location: NORTHAMPTON, England, UK

Re: Non-breaking space failure

Postby Chicago_HPT on Mon Sep 23, 2019 7:47 am

Did you try wrapping the phone number in a custom span tag, like the one I suggested? From my limited research it seems the problem may be due to browsers (and maybe print) breaking before a parenthesis (or bracket or other punctuation) even if it's preceded by a non-breaking space character.
Chicago_HPT
Propeller Head
 
Posts: 77
Joined: Sun Feb 03, 2013 6:01 pm


Return to Printed Documentation Targets

Who is online

Users browsing this forum: No registered users and 2 guests