View Single Post
Old 03-01-2020, 08:43 AM   #3
MerlinMama
Evangelist
MerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beautyMerlinMama does all things with Zen-like beauty
 
MerlinMama's Avatar
 
Posts: 498
Karma: 32554
Join Date: May 2014
Location: Canada
Device: Kobo Sage
Quote:
Originally Posted by stumped View Post
do it in two passes.
1 remove italic tags from paragraphs
then
2 remove the section tags

if you post a sample section it will be easier to help

e.g. to remove the form tags
find <form>(.*)</form)
replace with \1
Oh, I want to keep the section tags, just remove the italics from within the section tags (I have over 100 different sections in the text, and they can have either just one paragraph or many paragraphs).

Here's an example:
Spoiler:

Start with:

<form>
<p><em>Blah, blah, blah.</em></p>
<p><em>"Blah, blah-blah, blaaah."</em></p>
</form>

End with:

<form>
<p>Blah, blah, blah.</p>
<p>"Blah, blah-blah, blaaah."</p>
</form>


And more difficult, but if possible:
Spoiler:

Start with:

<form>
<p><em>Blah, blah, blah.</em></p>
<p><em>"Blah, </em>blah-blah<em>, blaaah."<em></p>
</form>

End with:

<form>
<p>Blah, blah, blah.</p>
<p>"Blah, <strong>blah-blah</strong>, blaaah."</p>
</form>
MerlinMama is offline   Reply With Quote