Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 07:08 AM   #1
ptm@xact.co.uk
Junior Member
ptm@xact.co.uk began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Aug 2024
Device: none
Question XHTML closing tag issue

Simply by parsing and committing an xhtml file, using the container, I see the following changes to the content.

Before parsing:
<span x="y"/>
<div id="w"/>

After committing:
<span x="y"></span>
<div id="w"></div>

Is there a 'tweak' setting or other method I can use to preserve the compact version of for tags with only attributes and no content?
ptm@xact.co.uk is offline   Reply With Quote
Old Yesterday, 07:43 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,195
Karma: 23000010
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No there isn't, IIRC.
kovidgoyal is offline   Reply With Quote
Old Today, 11:40 AM   #3
ptm@xact.co.uk
Junior Member
ptm@xact.co.uk began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Aug 2024
Device: none
I have not looked at the Calibre code. Hopefully there is an option on the serializer to use compact closing tags (i.e. <sometag/>) instead of <sometag></sometag>. If this is the case, how difficult do you think it would be to add a tweak to set this option? Is this something you or I can look at? I would need a few hints where to start looking.
ptm@xact.co.uk is offline   Reply With Quote
Old Today, 11:44 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,195
Karma: 23000010
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
This is done deliberately, see line 441 in oeb/base.py
kovidgoyal is offline   Reply With Quote
Old Today, 01:20 PM   #5
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: 75,363
Karma: 133807966
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 ptm@xact.co.uk View Post
I have not looked at the Calibre code. Hopefully there is an option on the serializer to use compact closing tags (i.e. <sometag/>) instead of <sometag></sometag>. If this is the case, how difficult do you think it would be to add a tweak to set this option? Is this something you or I can look at? I would need a few hints where to start looking.
Most tags are <sometag>Text from the book</sometag>. That's why it should not be done. <sometag/>This is text from the book will not work.
JSWolf is offline   Reply With Quote
Reply

Tags
xhtml tags


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting self closing tags (xhtml) roger64 Editor 2 03-04-2018 05:49 AM
TOC nav.xhtml issue ebookscovers Conversion 1 05-06-2017 11:12 AM
questions on self-closing tags and legal xhtml in epubs KevinH ePub 5 04-23-2012 10:12 PM
Issue closing ebook reader in Linux hairybiker Calibre 8 05-31-2011 02:17 PM
Issue with converting xhtml to epub using Calibre sg31 Calibre 0 10-20-2009 06:26 PM


All times are GMT -4. The time now is 04:29 PM.


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