07-20-2019, 10:32 PM | #1 |
Junior Member
Posts: 2
Karma: 10
Join Date: Jul 2019
Device: web
|
Epub->htmlz: Add <p> tags as <div class="Para"> children
Hello!
I have an epub that I am looking to fix when I export it to HTMLZ. Currently, it defines the paragraph by a <div> with the class "Para" (short for 'Paragraph'). I am sure that I could just do a search and replace for all div that meet this criteria, just turning <div class="Para"> into <p>, but there are also 'id' tags in the mix, which are used for links. So ideally, I'd like to add a child class to these divs. Here's a quick example: Current Epub: <div id="link001" class="Para"> Let's start off by saying... </div> Current HTMLZ: <div id="link001" class="Para"> Let's start off by saying... </div> Expected HTMLZ: <div id="link001" class="Para"> <p> Let's start off by saying... </p> </div> Is this possible? Thank you! |
07-21-2019, 11:39 AM | #2 |
Well trained by Cats
Posts: 29,792
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Diaps Editing Toolbag Plugin does this type of conversion/retag. Just remember to tick the Keep
https://www.mobileread.com/forums/sh....php?p=2980740 (It's on the Help: Get Plugins List. The easy way to install) |
Advert | |
|
07-21-2019, 02:51 PM | #3 |
Wizard
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
My first thought was to use a regular expression to change the 3 characters div to p so that you retain the ids for the linking and the class for any formatting. Make the regular expression match the div at the beginning and the "Para" at the end. But then I can't see how to change what was the matching div to a p since there are likely other non-Para divs. Maybe Diap's thing can do what I'm thinking of.
|
07-21-2019, 02:58 PM | #4 | |
Resident Curmudgeon
Posts: 73,943
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
<div id="(.*)" class="Para"> Replace with... <p id="\1"> |
|
07-21-2019, 03:34 PM | #5 |
Wizard
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
|
Advert | |
|
07-21-2019, 04:25 PM | #6 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
|
07-21-2019, 05:04 PM | #7 |
Resident Curmudgeon
Posts: 73,943
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
07-21-2019, 05:09 PM | #8 |
Resident Curmudgeon
Posts: 73,943
Karma: 128903250
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
07-21-2019, 09:46 PM | #9 |
Junior Member
Posts: 2
Karma: 10
Join Date: Jul 2019
Device: web
|
Yes - this was exactly what I was looking for. It looks a bit manual in that you need to do each html file separately, but it gets the job done.
I'm attaching the settings that worked for me in case someone runs into this same issue. Thanks! |
07-21-2019, 09:48 PM | #10 |
Wizard
Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Try dragging or shift clicking and select several files; some of the plugins allow you to work on several files at the same time.
Last edited by lumpynose; 07-21-2019 at 09:55 PM. |
07-21-2019, 10:42 PM | #11 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
|
07-21-2019, 11:06 PM | #12 |
Well trained by Cats
Posts: 29,792
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
Tags |
epub, htmlz, paragraphing |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DOCX->EPUB Header / <p class=" "> | ElPeregrino | Conversion | 5 | 09-05-2018 02:29 AM |
When I use merge as an option during ADD my "add tags" don't get added | LadyKate | Library Management | 9 | 11-19-2016 07:49 PM |
Changing or removing <div class="calibrenavbar"> | ptsefton | Recipes | 3 | 05-28-2011 08:30 AM |
Tags appearing when "Add Empty Book" | fio_smiles | Library Management | 2 | 03-11-2011 03:43 AM |
Line indents using "<div>" tags | HarryT | Kindle Formats | 11 | 04-29-2009 10:18 PM |