Prevent line breaks on underscore character?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
esachs
Jr. Propeller Head
Posts: 7
Joined: Wed Mar 06, 2013 5:04 pm

Prevent line breaks on underscore character?

Post by esachs »

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?
svt-user
Propeller Head
Posts: 18
Joined: Tue Jun 12, 2012 6:14 am

Re: Prevent line breaks on underscore character?

Post by svt-user »

You could use a non-breaking thinspace around the underscore:

Code: Select all

USER _ ACCOUNT
.
Nick A
Propeller Head
Posts: 15
Joined: Thu Sep 20, 2018 1:10 am

Re: Prevent line breaks on underscore character?

Post by Nick A »

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.
kgdyall
Propeller Head
Posts: 12
Joined: Fri Jun 17, 2016 8:48 am

Re: Prevent line breaks on underscore character?

Post by kgdyall »

I've used a zero-width joiner (‍) in other contexts where I don't want to add space (like  ) 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.
Post Reply