02-10-2011, 01:33 PM | #1 |
Junior Member
Posts: 6
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
|
Markdown HTML problem
Hi, this is my first post here so it's bound to be silly.
I have Calibre 0.7.44 running under Ubuntu 10.10. What I have been trying to do is to use Markdown to produce HTML for importing into Calibre for onward conversion to MOBI. The document is an old novel that includes passages of poetry and it is the poetry that is where the problem lies. The HTML from Markdown looks (to me, as a non-expert) reasonable, but when I convert this to MOBI using the default setting I get spurious blank lines inserted in the output. It's as if Calibre is inserting the odd <br /> tag. Below, a sample of the HTML from Markdown. Code:
<p>Before the Roman came to Rye or out to Severn strode, <br /> The rolling English drunkard made the rolling English road. <br /> A reeling road, a rolling road, that rambles round the shire, <br /> And after him the parson ran, the sexton and the squire; <br /> A merry road, a mazy road, and such as we did tread <br /> The night we went to Birmingham by way of Beachy Head.</p> <p>I knew no harm of Bonaparte and plenty of the Squire, <br /> And for to fight the Frenchman I did not much desire; <br /> But I did bash their baggonets because they came arrayed <br /> To straighten out the crooked road an English drunkard made, <br /> Where you and I went down the lane with ale-mugs in our hands, <br /> The night we went to Glastonbury by way of Goodwin Sands.</p> Regards, Nick. Last edited by nhopton; 02-10-2011 at 01:41 PM. |
02-10-2011, 01:35 PM | #2 |
creator of calibre
Posts: 44,560
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I'm confused are you saying you are getting extra blank lines or missing blank lines?
|
02-10-2011, 02:02 PM | #3 |
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
How are you genrating the markdown html? Also, does it display properly when using calibre's viewer.
|
02-10-2011, 02:22 PM | #4 |
Junior Member
Posts: 6
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
|
Sorry, it is inserting extra white lines, one in each verse.
Regards, Nick. |
02-10-2011, 02:25 PM | #5 | |
Junior Member
Posts: 6
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
|
Quote:
Regards, Nick. |
|
02-10-2011, 02:43 PM | #6 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Try adjusting Calibre's css. Extra CSS box under look and feel:
p {margin-top:.1em; margin-bottom:.1em} |
02-10-2011, 03:04 PM | #7 |
Junior Member
Posts: 6
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
|
|
02-10-2011, 03:26 PM | #8 |
Junior Member
Posts: 6
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
|
Ah, I think we might be getting somewhere. If I load the HTML produced by Markdown into an HTML editor (GWrite) some extra code is inserted automatically, see the codebox. This does import to Calibre and convert to MOBI properly. So at least I have a work-around.
Code:
<!DOCTYPE html> <html> <head></head><body><p>Before the Roman came to Rye or out to Severn strode, <br> The rolling English drunkard made the rolling English road. <br> A reeling road, a rolling road, that rambles round the shire, <br> And after him the parson ran, the sexton and the squire; <br> A merry road, a mazy road, and such as we did tread <br> The night we went to Birmingham by way of Beachy Head. </p> <p>I knew no harm of Bonaparte and plenty of the Squire, <br> And for to fight the Frenchman I did not much desire; <br> But I did bash their baggonets because they came arrayed <br> To straighten out the crooked road an English drunkard made, <br> Where you and I went down the lane with ale-mugs in our hands, <br> The night we went to Glastonbury by way of Goodwin Sands. </p> </body> </html> |
02-10-2011, 03:28 PM | #9 |
creator of calibre
Posts: 44,560
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
deleted
|
02-10-2011, 04:29 PM | #10 |
Sigil & calibre developer
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
I am a bit confused, why are you converting to the Markdown formatted text to HTML and then using calibre to convert the HTML? calibr supports Markdown formatted TXT.
|
02-10-2011, 06:43 PM | #11 | |
Junior Member
Posts: 6
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
|
Quote:
That's a couple of pints I owe you, should ever you have the melancholy distinction of finding yourself in my home town. Regards, Nick. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Markdown Syntax in Comments | itimpi | Calibre | 11 | 01-25-2011 12:28 PM |
->Txt+Markdown | Perkin | Calibre | 2 | 12-11-2010 05:04 AM |
Capture intermediate html from markdown | Agama | Calibre | 3 | 07-30-2010 12:33 PM |
Markdown editor | user_none | Workshop | 0 | 08-30-2009 10:25 PM |
html problem | Nate the great | Workshop | 12 | 03-17-2009 09:38 AM |