Word Wrap and Plain-Text Paste

Everything related to our flagship word processor.
Post Reply
hatchmo
Posts: 99
Joined: 2004-03-01 10:35:56
Location: Cotati, CA

Word Wrap and Plain-Text Paste

Post by hatchmo »

Pasting as plain text retains special characters from some web pages.
These special characters prevent proper paragraph wrap.
In the attached example, that character is

Code: Select all

\u160 ?
Should that be considered part of unformatted text?
Attachments
Text Wrap Problem.rtf
(200.93 KiB) Downloaded 131 times
Al Hatch
User avatar
xiamenese
Posts: 543
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Word Wrap and Plain-Text Paste

Post by xiamenese »

Does the "Zap Gremlins" macro not remove them?

:)

Mark
adryan
Posts: 561
Joined: 2014-02-08 12:57:03
Location: Australia

Re: Word Wrap and Plain-Text Paste

Post by adryan »

G'day, Mark, Al et al

No, it doesn't. And I think the reason this thing persists with Al's pasting is that it is a No Break Space (U+00A0) which is treated pretty much like any other character and not part of formatting per se. All occurrences can easily be replaced with ordinary Spaces using Find & Replace (which could then be Macroized).

The character seems to be an increasingly common (and annoying) occurrence in Web pages. It's rarely appropriate, and I think it bespeaks sloppy programming.

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
User avatar
xiamenese
Posts: 543
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Word Wrap and Plain-Text Paste

Post by xiamenese »

Thanks Adrian for pointing that out… I failed to pay attention to what \u160 is!

I get a lot of documents sent to me in DOCX format which are also peppered with those No-Break Spaces. I just replace them as I see them, though a quick macro might be useful.

I also replace them ( ) on the website I edit as they seem to get added automatically by the built-in editor in places for which I cannot see any justification.

:D

Mark
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Word Wrap and Plain-Text Paste

Post by martin »

Non-breaking spaces can be a nuisance. I can't imagine the intentions behind all the non-breaking spaces in the sample text that was posted. It's out of control!

But non-breaking spaces are also quite useful if deployed intelligently. Especially as they are actual character codes instead of formatting like "nowrap"; that makes them nearly universally supported by all modern apps. They can ensure a noun phrase like a proper name always stays together on the same line, which can be nice for aesthetics.

As Adrian mentioned, you can use Nisus Writer's find to quickly replace them all with normal spaces. If you do this a lot it's a good candidate to be macro-ized.
User avatar
xiamenese
Posts: 543
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Word Wrap and Plain-Text Paste

Post by xiamenese »

Absolutely agree, Martin. But why Word and many other editors like JCE (in Joomla) chuck them in all over the place mystifies me.

:D

Mark
Post Reply