Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-03-2024, 03:22 PM   #1
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 2,264
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.
Gregg Bell is offline   Reply With Quote
Old 04-03-2024, 04:25 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,277
Karma: 129333566
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Gregg Bell View Post
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.
The easiest way to find a missing <p> or </p> is to install the epubcheck plugin and run that. It will find any structural errors and show you what they are and where they are. You can double-click on the error and be taken to where the error is. It's the easiest way to do this.

URL for epubcheck for Sigil
https://www.mobileread.com/forums/sh...d.php?t=248186
JSWolf is offline   Reply With Quote
Advert
Old 04-03-2024, 05:13 PM   #3
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 2,264
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
Quote:
Originally Posted by JSWolf View Post
The easiest way to find a missing <p> or </p> is to install the epubcheck plugin and run that. It will find any structural errors and show you what they are and where they are. You can double-click on the error and be taken to where the error is. It's the easiest way to do this.

URL for epubcheck for Sigil
https://www.mobileread.com/forums/sh...d.php?t=248186
Thanks Jon. I tested it and epub check caught three out of five missing tags. Just to be clear, the below example is what I'm looking to find:

Code:
"It was a sunny day in the neighborhood."</p>
Gregg Bell is offline   Reply With Quote
Old 04-03-2024, 05:34 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,277
Karma: 129333566
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Gregg Bell View Post
Thanks Jon. I tested it and epub check caught three out of five missing tags. Just to be clear, the below example is what I'm looking to find:

Code:
"It was a sunny day in the neighborhood."</p>
I just tested in Sigil and if the beginning <p> is missing, the preview will show an error. If an end </p> is missing, preview will also show an error. The error is not something you will miss.

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.
JSWolf is offline   Reply With Quote
Old 04-03-2024, 05:58 PM   #5
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 2,264
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
Quote:
Originally Posted by JSWolf View Post
I just tested in Sigil and if the beginning <p> is missing, the preview will show an error. If an end </p> is missing, preview will also show an error. The error is not something you will miss.

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.
Thanks but isn't that if you're editing and you somehow remove a ptag? When you first open an html, it doesn't show the missing ptags in the preview.
Gregg Bell is offline   Reply With Quote
Advert
Old 04-03-2024, 09:10 PM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,675
Karma: 5433388
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.
KevinH is offline   Reply With Quote
Old 04-04-2024, 02:57 PM   #7
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 2,264
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
Quote:
Originally Posted by KevinH View Post
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.
Great, Kevin. Thanks. Three questions.
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.)
Gregg Bell is offline   Reply With Quote
Old 04-04-2024, 03:07 PM   #8
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,802
Karma: 145624992
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Gregg Bell View Post
2) Do the files have to be xhtml or just html for the Preview and Well-Formed/Sanity check to detect such issues?
Not quite sure what you mean. The files in the Text segment need to be xhtml/html files to meet the standard. Either is acceptable.

Quote:
Originally Posted by Gregg Bell View Post
3) What does the Tools>Validate Stylesheets with W3C do? (It just seems to open the stylesheet in Notepad.)
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.
Attached Thumbnails
Click image for larger version

Name:	w3c_validate.png
Views:	37
Size:	5.7 KB
ID:	207351   Click image for larger version

Name:	w3c_validator_results.png
Views:	40
Size:	105.8 KB
ID:	207352  

Last edited by DNSB; 04-04-2024 at 03:11 PM.
DNSB is online now   Reply With Quote
Old 04-04-2024, 04:27 PM   #9
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,105
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by Gregg Bell View Post
Great, Kevin. Thanks. Three questions.
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?
It's the same thing...you are running a "Sanity" check using the tool: Well-Formed check...

Quote:
Originally Posted by Gregg Bell View Post
2) Do the files have to be xhtml or just html for the Preview and Well-Formed/Sanity check to detect such issues?
xhtml IS html...it's just following rules that are a little more strict...like requiring a closing </p> tags at the end of each paragraph, or all lower-case tags (<p> and not <P>). The end of the file does not have to be ".xhtml" it is just a convention to show you are following the stricter rule requirements.

Quote:
Originally Posted by Gregg Bell View Post
3) What does the Tools>Validate Stylesheets with W3C do? (It just seems to open the stylesheet in Notepad.)
It sends the contents of your stylesheet to an online checker to make sure it is correct. Make sure you have the stylesheet selected when you click on the tool. You can select which standard (CSS 2/2.1/3) to check against in General Settings/Validation Tab.
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.
Turtle91 is offline   Reply With Quote
Old 04-04-2024, 05:31 PM   #10
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 2,264
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
Quote:
Originally Posted by DNSB View Post
Not quite sure what you mean. The files in the Text segment need to be xhtml/html files to meet the standard. Either is acceptable.



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.
Thanks David. When my W3C validation opens it is in Notepad but (I didn't notice this earlier) there is something about not having Java and needing to send it to the W3C address.

Now I realize I an just go to the W3C site to check the CSS.
Gregg Bell is offline   Reply With Quote
Old 04-04-2024, 05:41 PM   #11
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 2,264
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
Quote:
Originally Posted by Turtle91 View Post
It's the same thing...you are running a "Sanity" check using the tool: Well-Formed check...


xhtml IS html...it's just following rules that are a little more strict...like requiring a closing </p> tags at the end of each paragraph, or all lower-case tags (<p> and not <P>). The end of the file does not have to be ".xhtml" it is just a convention to show you are following the stricter rule requirements.


It sends the contents of your stylesheet to an online checker to make sure it is correct. Make sure you have the stylesheet selected when you click on the tool. You can select which standard (CSS 2/2.1/3) to check against in General Settings/Validation Tab.
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!
Thanks for clearing things up, Dion. I put the CSS Validator plugin in and with the CSS stylsheet in the bookbrowser it worked fine. Thanks for suggesting it. Question: When I enter an html file (from LibreOffice Writer--they're just chapters in a novel) Sigil formulates the files as .html files. Does going through those .html files and manually adding the "x" to them turn them into .xhtml files?
Gregg Bell is offline   Reply With Quote
Old 04-04-2024, 06:30 PM   #12
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,675
Karma: 5433388
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).
KevinH is offline   Reply With Quote
Old 04-05-2024, 07:29 PM   #13
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 2,264
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
Quote:
Originally Posted by KevinH View Post
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).
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"?
Gregg Bell is offline   Reply With Quote
Old 04-05-2024, 08:22 PM   #14
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,802
Karma: 145624992
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Gregg Bell View Post
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"?
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.
DNSB is online now   Reply With Quote
Old 04-06-2024, 01:59 PM   #15
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 2,264
Karma: 3917588
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
Quote:
Originally Posted by DNSB View Post
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.
Thanks David. But what does "Going forward, HTML5 is going to be the path" mean?
Gregg Bell is offline   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 12:14 AM.


MobileRead.com is a privately owned, operated and funded community.