04-03-2024, 03:22 PM | #1 |
Gregg Bell
Posts: 2,265
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
|
How to find missing p tags?
I was cleaning up a big file in Sigil and came across a missing opening p tag (<p>). It made me wonder if there were more missing opening or closing p tags and how I might find them. (Perhaps with normal Find or Regex Find. Or some other way besides going through the whole document manually.) And a second question: does the "Mend and prettify all HTML files" automatically put in any opening or closing p tags that might be missing? Thanks.
|
04-03-2024, 04:25 PM | #2 | |
Resident Curmudgeon
Posts: 75,917
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
URL for epubcheck for Sigil https://www.mobileread.com/forums/sh...d.php?t=248186 |
|
Advert | |
|
04-03-2024, 05:13 PM | #3 | |
Gregg Bell
Posts: 2,265
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
|
Quote:
Code:
"It was a sunny day in the neighborhood."</p> |
|
04-03-2024, 05:34 PM | #4 | |
Resident Curmudgeon
Posts: 75,917
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Code:
This page contains the following errors: error on line 15 at column 255: Opening and ending tag mismatch: body line 7 and p Below is a rendering of the page up to the first error. |
|
04-03-2024, 05:58 PM | #5 | |
Gregg Bell
Posts: 2,265
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
|
Quote:
|
|
Advert | |
|
04-03-2024, 09:10 PM | #6 |
Sigil Developer
Posts: 8,099
Karma: 5450184
Join Date: Nov 2009
Device: many
|
It will always show any missing tags in Preview when you open each xhtml file. You can also run a Well-Formed/Sanity check to detect issues of this sort.
|
04-04-2024, 02:57 PM | #7 | |
Gregg Bell
Posts: 2,265
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
|
Quote:
1) I don't see any "Sanity" on my 2.1.0 Sigil. I just have Tools>Well-formed check Epub. Is that the same thing? 2) Do the files have to be xhtml or just html for the Preview and Well-Formed/Sanity check to detect such issues? 3) What does the Tools>Validate Stylesheets with W3C do? (It just seems to open the stylesheet in Notepad.) |
|
04-04-2024, 03:07 PM | #8 | |
Bibliophagist
Posts: 39,520
Karma: 154108302
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
For me, it opens the stylesheet on the W3C validation service. I get a popup in my web browser as seen in the attached image and the validator results in the second attached image. Last edited by DNSB; 04-04-2024 at 03:11 PM. |
|
04-04-2024, 04:27 PM | #9 | |||
A Hairy Wizard
Posts: 3,186
Karma: 18843349
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
Quote:
Quote:
I personally use the CSSValidator plugin instead... It keeps the check local instead of sending it online. edit: actually not sure that it is required to have the stylesheet selected in bookbrowser first... I think Sigil automatically checks anything on any stylesheet in the book; it doesn't even have to be properly linked to an html file! Last edited by Turtle91; 04-04-2024 at 04:59 PM. |
|||
04-04-2024, 05:31 PM | #10 | |
Gregg Bell
Posts: 2,265
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
|
Quote:
Now I realize I an just go to the W3C site to check the CSS. |
|
04-04-2024, 05:41 PM | #11 | |
Gregg Bell
Posts: 2,265
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
|
Quote:
|
|
04-04-2024, 06:30 PM | #12 |
Sigil Developer
Posts: 8,099
Karma: 5450184
Join Date: Nov 2009
Device: many
|
No. But running Sigil's Mend on them will properly convert html into valid xhtml no matter the file extension it has (.htm, .html, .xhtml).
|
04-05-2024, 07:29 PM | #13 |
Gregg Bell
Posts: 2,265
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
|
Thanks Kevin. So running "Mend & Prettify" turns the .html into .xhtml but it still looks like .html? So then after running "Mend & Prettify" add the "x"?
|
04-05-2024, 08:22 PM | #14 |
Bibliophagist
Posts: 39,520
Karma: 154108302
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
If you really want to. It doesn't make a difference to how the files are handled. XHTML is stricter in many features such as needing to close tags. Going forward, HTML5 is going to be the path.
|
04-06-2024, 01:59 PM | #15 |
Gregg Bell
Posts: 2,265
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
|
Thanks David. But what does "Going forward, HTML5 is going to be the path" mean?
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to find books that have less than X number of tags? | Lily7 | Library Management | 3 | 11-24-2023 04:48 PM |
How to find tags that have missing spaces? | Rellwood | Library Management | 0 | 09-17-2022 02:34 AM |
Missing tags | Ted Friesen | Library Management | 1 | 10-31-2020 08:45 PM |
Missing Tags | Ron. | Library Management | 2 | 08-14-2012 11:21 PM |
Tags going missing on transfer | sideburnt | Calibre | 9 | 09-21-2009 12:18 AM |