Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 08-11-2013, 02:51 AM   #1
ibu
Addict
ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.
 
Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
Sigil changes markup of empty elements when the document is saved

I used an empty element like
Code:
<div class="pause" />
Sigil changes the markup automatically into
Code:
<div class="pause"></div>
when the document is saved.

Can I prevent that?

Note:
Sigil does not replace
Code:
<hr />
Thanks.
ibu is offline   Reply With Quote
Old 08-11-2013, 03:37 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
You know it is the same, right? The difference is that hr (and also some others like br, img) do not have a closing tag.
Although they are the same and it is valid, it does not matter.
You could try different cleaning options. If that does not work, it is probably a side effect.
Toxaris is offline   Reply With Quote
Old 08-11-2013, 03:44 AM   #3
ibu
Addict
ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.
 
Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
@Toxaris
For empty elements I prefer the short form.

Well, OK, I just wanted to know, if you can change the behaviour of Sigil.

To be not missunderstood:
I don't want to clean that element. It has a function.
ibu is offline   Reply With Quote
Old 08-11-2013, 07:26 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,905
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by ibu View Post
@Toxaris
For empty elements I prefer the short form.

Well, OK, I just wanted to know, if you can change the behaviour of Sigil.

To be not missunderstood:
I don't want to clean that element. It has a function.
That is a function of the cleaning options you set in preferences. You do not get the option to fine tune each of THOSE choices.
theducks is offline   Reply With Quote
Old 08-11-2013, 09:05 AM   #5
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
I suspect this behavior is a conscious choice on the part of the developers. It may facilitate the operation of flightcrew or other functions in the program to have everything standardized one way, with the few exceptions for hr, br and image which are nearly always self closing.
mrmikel is offline   Reply With Quote
Old 08-12-2013, 11:19 AM   #6
exaltedwombat
Guru
exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.
 
Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
Quote:
Originally Posted by ibu View Post
I used an empty element like
Code:
<div class="pause" />
Sigil changes the markup automatically into
Code:
<div class="pause"></div>
when the document is saved.

Can I prevent that?

Note:
Sigil does not replace
Code:
<hr />
Thanks.
You can prevent the automatic cleanup when opening and closing a file. But if you DO run cleanup, you're going to get the closing tag added.

What does the element do for you? Could it do it just as well with a closing tag?
exaltedwombat is offline   Reply With Quote
Old 08-12-2013, 11:45 AM   #7
ibu
Addict
ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.
 
Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
@exaltedwombat
Deactivating the complete cleanup is a to big disadvantage.

You asked what the element does for me.
For an element without content it's just the nicest markup.

No more, no less.

No I know, that there's no solution in sigil for the problem, so I will live with the markup which is less nice. That's OK.
ibu is offline   Reply With Quote
Old 08-12-2013, 11:55 AM   #8
exaltedwombat
Guru
exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.
 
Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
I ALWAYS deactivate the auto cleanup. If I want a file cleaned, I can ask for it!

You said "I don't want to clean that element. It has a function. "
Will you satisfy my curiosity? What function?
exaltedwombat is offline   Reply With Quote
Old 08-12-2013, 12:13 PM   #9
ibu
Addict
ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.ibu can eat soup with a fork.
 
Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
@exaltedwombat
Sigil does not offer a list of all code which it will be cleaned, when you affirm.
That's why I give up the wish to be asked before.
But I agree with you. It's better to be asked for all critical cleaning actions.

Ok, I give an example for the empty element. Please understand my reservation about that. I don't want to run into a new discussion of "what is good markup" again. Like in a thread some days ago.

In many books the editor/author uses a single empty paragraph to indicate a change of the perspective or the change of the time inside a chapter - where a split with a new chapter would be a to strong instrument.

For such a purpose
<div class="pause" />
it's nice markup.

A margin-bottom for the paragraph before or a margin-top for the paragraph behind is not appropriate.

The pause does not "belong" to only one these two paragraphs. But more important:
there's semantic in the message. Therefor CSS is not a good choice.
ibu is offline   Reply With Quote
Old 08-12-2013, 01:39 PM   #10
exaltedwombat
Guru
exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.
 
Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
Yes, that's a pretty common layout use of an empty div. Don't see how it gets you out of using css though - the class "pause" would have to be defined in the stylesheet as something like:

.pause{
padding-top:1em;
}

in order to have any effect - and that's css!

Sure, code it as an empty element, neither FlightCrew, EpubCheck or Kindle Previewer seem to care. If you decide to run Cleanup in Sigil, and it wants it to have a closing tag, no-one except you will ever know. I like minimal code too, but life's too short!
exaltedwombat is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Empty Books to store other document types africalass Library Management 8 04-30-2012 12:22 PM
cleaning up a word document in Sigil BeccaPrice Sigil 9 10-08-2011 03:06 PM
Sigil and epub (can I delete empty chapters?) desaderal Sigil 3 03-24-2011 07:57 AM
Calibre 0.7.22, Empty eBooks not saved on Save to disk? Nadrek Calibre 3 10-04-2010 12:24 PM
Sigil shows a blank document when importing valid HTML walter2 Sigil 15 03-25-2010 07:17 AM


All times are GMT -4. The time now is 05:18 AM.


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