Page 1 of 1

Form Paragraph Macro

Posted: 2007-08-18 10:13:48
by hatchmo
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.

Posted: 2007-08-19 19:26:05
by martin
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: Select all

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

Posted: 2007-08-28 17:58:47
by hatchmo
I believe that's the problem.

Code: Select all

Find and Replace '[\n\r]+', ' ', 'Esa'
Replaces all double-spaces with a space. I would like it not to do that.

Posted: 2007-08-28 18:17:35
by hatchmo
I changed that line to

Code: Select all

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.

Posted: 2007-08-28 23:08:37
by martin
hatchmo wrote:

Code: Select all

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?