View Single Post
Old 08-23-2015, 11:27 AM   #3
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 588
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
You need four "replace all"s in total:
Quote:
Originally Posted by phossler View Post
1. Put <p> tags around the blocks of text that don't have any? I can delete the <br/>'s
Two steps:
(1) Wrap the body in <p>...</p>
Find: <body>(.*?)</body>
Replace: <body>\n<p>\1</p>\n</body>

(2) Replace all the <br/>s
Find: <br/>
Replace: </p>\n<p>

Quote:
Originally Posted by phossler View Post
2. Put <p> tags around the blocks of text inside <blockquotes>'s that don't have any? I can delete the <blockquote>'s manually if I need to
Find: <blockquote>(.*?)</blockquote>
Replace: <blockquote>\n<p>\1</p>\n</blockquote>

Or, if you just want plain paras instead of blockquotes,

Replace: <p>\1</p>

Quote:
Originally Posted by phossler View Post
3. Remove the spaces that are outside <p>'s?
Find: </p>\s*<p>
Replace: </p>\n<p>

Last edited by Phssthpok; 08-23-2015 at 11:29 AM.
Phssthpok is offline   Reply With Quote