Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-15-2014, 08:46 AM   #1
Bertrand
Zealot
Bertrand began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Dec 2008
Location: France
Device: None
Beautify code : a few glitches ?

Nothing really serious, just some curious behaviors.

1. I create a table like this, before entering data, with empty cells :

Before :
Code:
<table>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
and click Beautify

After :
Code:
<table>

    <tr>
      <td/>
      <td/>
      <td/>
      <td/>
    </tr>

  </table>
See TD tags ? This is not valid HTML.
(No big deal, putting a temporary space inside empty cells solved the problem.)


2 . I have some paragraphs like this (copy/paste from an other app) :
Code:
<p>
hello
</p>
After Beautify, I was expecting something like :
Code:
<p>hello</p>
But I got only this :
Code:
  <p>
hello
</p>
Same thing for h1, etc.

3. Last thing :
If the closing tag for a HTML comment is at the very beginning of a line, the code after this closing tag loses the syntax highlighting. It seems that at least a space is needed at the beginning of the line to avoid this behavior.
Attached Thumbnails
Click image for larger version

Name:	2014-03-15 13 40 14.png
Views:	357
Size:	6.0 KB
ID:	120273  
Bertrand is offline   Reply With Quote
Old 03-15-2014, 09:06 AM   #2
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by Bertrand View Post
Nothing really serious, just some curious behaviors.

1. I create a table like this, before entering data, with empty cells :

Before :
Code:
<table>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
and click Beautify

After :
Code:
<table>

    <tr>
      <td/>
      <td/>
      <td/>
      <td/>
    </tr>

  </table>
See TD tags ? This is not valid HTML.
(No big deal, putting a temporary space inside empty cells solved the problem.)
Yes it IS valid XHTML (although a bit unusual). The trailing /> means that no closing tag is needed.
itimpi is offline   Reply With Quote
Advert
Old 03-15-2014, 09:46 AM   #3
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: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
1. it is valid

2. Beautify does not beautify inside p tags. It only beautifies block level tags that contain only other block level tags and no text.

3. Will be fixed in the next release.
kovidgoyal is offline   Reply With Quote
Old 03-15-2014, 12:43 PM   #4
Bertrand
Zealot
Bertrand began at the beginning.
 
Posts: 124
Karma: 10
Join Date: Dec 2008
Location: France
Device: None
Ok thanks !

(About < td /> it's quite a surprise. I'm aware of hr, br, img tags in xhtml but I've never seen this with td. (I'm used to Dreamweaver and I've never seen this when using the Format Code option). Just learned something new today...)
Bertrand is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beautify feature BobC Editor 1 03-15-2014 09:24 AM
Least Glitches Bittybye Which one should I buy? 4 08-19-2012 08:48 PM
Are these Glitches ??? cancelx Astak EZReader 5 04-20-2010 03:29 PM
Beautify Baen e-books IceHand Workshop 1 02-21-2008 09:57 AM


All times are GMT -4. The time now is 01:00 AM.


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