Reply to topic  [ 5 posts ] 
Form Paragraph Macro 
Author Message

Joined: 2004-03-01 10:35:56
Posts: 76
Location: Cotati, CA
Earlier versions of Nisus Writer used to ship with a "Form Paragraph" macro that preserved double-spaces in the selected text.
Does anyone still have that routine/macro you could post for me? I'm having a tough time converting the perl macro so that it doesn't turn all the selected text into one massive paragraph.

_________________
Al Hatch


2007-08-18 10:13:48
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
Post 
The "Form Paragraph" macro that ships with NWP should preserve any double-spaces in your text. It's default menu location is Macro > changing text > Form Paragraph. In case something happened to the macro, here it is:

Code:
#Combines selected lines into one paragraph
Find and Replace '[\n\r]+', ' ', 'Esa'
Find and Replace '  +', ' ', 'Esa'


2007-08-19 19:26:05
Profile WWW

Joined: 2004-03-01 10:35:56
Posts: 76
Location: Cotati, CA
Post 
I believe that's the problem.

Code:
Find and Replace '[\n\r]+', ' ', 'Esa'


Replaces all double-spaces with a space. I would like it not to do that.

_________________
Al Hatch


2007-08-28 17:58:47
Profile

Joined: 2004-03-01 10:35:56
Posts: 76
Location: Cotati, CA
Post 
I changed that line to

Code:
Find and Replace '[\n\r]{1}', ' ', 'Esa'


So that it replaces only single occurences of a return. I think the default macro shipped with a typo.

_________________
Al Hatch


2007-08-28 18:17:35
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
Post 
hatchmo wrote:
Code:
Find and Replace '[\n\r]+', ' ', 'Esa'


Replaces all double-spaces with a space. I would like it not to do that.

Did you quote the wrong line of code? That line replaces one or more newlines, it does not replace any spaces, single or double. Or perhaps you meant that you wanted to preserve double-newlines?


2007-08-28 23:08:37
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software