Page 1 of 1

Improving the Form Paragraph macro

Posted: 2010-06-05 10:53:11
by vitaka
How could I modify the Form Paragraph macro (Find and Replace '(\S)[\t\x20]*\n(?![\n>])', '\1\x20', 'EasS') so that it first removes blank lines, as in the Add Remove Blank Lines macro, so that I can form a paragraph even across paragraphs that contain blank lines?

Re: Improving the Form Paragraph macro

Posted: 2010-06-06 13:39:48
by martin
You could go about this two ways. The first would be to just combine the relevant lines of code from both macros and run them in succession:

Code: Select all

# First delete all blank paragraphs
Find and Replace ‘\n\n+’, ‘\n’, ‘EasS’

# Combines selected lines into one paragraph
Find and Replace '(\S)[\t\x20]*\n(?![\n>])\x20*', '\1\x20', 'EasS'
Or you could modify the "Form Paragraph" search expression so that it matches empty paragraphs as well:

Code: Select all

Find and Replace '(\S)[\t\x20\n]+(?!>)\x20*', '\1\x20', 'EasS'

Re: Improving the Form Paragraph macro

Posted: 2010-06-07 20:27:30
by vitaka
Awesome! I like the second solution more elegant. Thanks!