![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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" /> Code:
<div class="pause"></div> Can I prevent that? Note: Sigil does not replace Code:
<hr /> |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#3 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#4 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
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.
|
![]() |
![]() |
![]() |
#5 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#6 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
|
Quote:
What does the element do for you? Could it do it just as well with a closing tag? |
|
![]() |
![]() |
![]() |
#7 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#8 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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? |
![]() |
![]() |
![]() |
#9 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#10 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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! |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |