Prevent line breaks on underscore character?

This forum is for all Flare issues related to styles, stylesheets and XML.

Prevent line breaks on underscore character?

Postby esachs on Wed Jun 12, 2013 9:06 am

We have a lot of values, structures, etc., with underscores in the name, for example, ROLE_ADMIN or _EXTERNAL. In code blocks, we use the <pre> tag, and they are not a problem, but we also use them in-line text and Flare is breaking these on the hyphen, for example:
automatically adds the suffix _
EXTERNAL


or

set these users to ROLE_
ADMIN to do something


I've looked online for a non-breaking underscore in HTML, but it doesn't seem to exist.

I've also tried creating a span class and setting the white-space attribute. However, it doesn't seem to be working (for a while it seemed like it did, but either it was never working or it stopped for some reason). I've tried normal, pre, pre-line, but they all still break on the underscore. "nowrap" will prevent the word from breaking on the _, but it won't put a carriage return before a long word, so you get:

blah blah blahblah blah blah
blah blah blahblah blah blah
blah blah blah blah blah _EXTERNAL
blah blah blahblah blah blah
blah blah blahblah blah blah


Any other ideas? Something I'm doing wrong?
esachs
Jr. Propeller Head
 
Posts: 7
Joined: Wed Mar 06, 2013 5:04 pm

Re: Prevent line breaks on underscore character?

Postby svt-user on Fri Jun 14, 2013 1:35 pm

You could use a non-breaking thinspace around the underscore:
Code: Select all
USER&#8201;_&#8201;ACCOUNT
.
svt-user
Propeller Head
 
Posts: 18
Joined: Tue Jun 12, 2012 6:14 am

Re: Prevent line breaks on underscore character?

Postby Nick A on Mon Nov 05, 2018 9:24 am

I'm having exactly the same problem. We have many programming function names such as DO_THIS_ACTION_NOW which are broken at the end of the line:

...you must use the DO_THIS_
ACTION_NOW function to enable...

Is there really no CSS span or MadCap custom tag to prevent a break within a particular string of text? The thin space character does not work, since the MadCap editor removes it.
Nick A
Propeller Head
 
Posts: 14
Joined: Thu Sep 20, 2018 1:10 am

Re: Prevent line breaks on underscore character?

Postby kgdyall on Mon Jun 29, 2020 2:00 pm

I've used a zero-width joiner (&zwj;) in other contexts where I don't want to add space (like &nbsp;) between two pieces of text. Not sure if this works in the Flare XML Editor, but maybe it works in HTML. My issue is with superscripts preceding text (as is commonly used for isotopes of elements): the XML Editor breaks the text after the superscript tags if it needs to wrap a line. However, when viewed as HTML in a browser, there's no issue of breaking the text in the middle: the whole piece is regarded as a single entity and wraps as a whole.
kgdyall
Propeller Head
 
Posts: 12
Joined: Fri Jun 17, 2016 8:48 am


Return to Styles, Stylesheets and XML

Who is online

Users browsing this forum: No registered users and 3 guests

cron