Improving the Form Paragraph macro
Improving the Form Paragraph macro
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?
- martin
- Official Nisus Person
- Posts: 5228
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Improving the Form Paragraph macro
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:
Or you could modify the "Form Paragraph" search expression so that it matches empty paragraphs as well:
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'
Code: Select all
Find and Replace '(\S)[\t\x20\n]+(?!>)\x20*', '\1\x20', 'EasS'
Re: Improving the Form Paragraph macro
Awesome! I like the second solution more elegant. Thanks!