Reply to topic  [ 3 posts ] 
Improving the Form Paragraph macro 
Author Message

Joined: 2007-10-25 11:41:30
Posts: 17
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?

2010-06-05 10:53:11
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
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:
# 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:
Find and Replace '(\S)[\t\x20\n]+(?!>)\x20*', '\1\x20', 'EasS'

2010-06-06 13:39:48
Profile WWW

Joined: 2007-10-25 11:41:30
Posts: 17
Awesome! I like the second solution more elegant. Thanks!

2010-06-07 20:27:30
Display posts from previous:  Sort by  
Reply to topic   [ 3 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