Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-14-2011, 07:53 AM   #1
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Markdown Query : Using Emphasis

Should Markdown emphasis be detected when applied within quotes?

With the following text:

Code:
_emphasis not in quotes_

"_emphasis in quotes_"
The first line triggers <em> tags but not the second. I just wondered whether this is standard Markdown processing or calibre's implementation.

Update: I have just tested on the Markdown website and <em> is triggered whether inside or outside of quotes, so it seems to be a calibre difference.

Last edited by Agama; 06-14-2011 at 10:08 AM. Reason: Update
Agama is offline   Reply With Quote
Old 06-14-2011, 11:19 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: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre uses a rather old python library to convert markdown, it's quite possible there are bugs in it. Updating to a newer library would mean re-writing all the ebook specific markup parts, which is not something I have the motivation to do at the moment.
kovidgoyal is online now   Reply With Quote
Advert
Old 06-14-2011, 12:03 PM   #3
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Enhancing Markdown input and output are high on my todo list. I will probably have time to start on it this weekend.
user_none is offline   Reply With Quote
Old 06-15-2011, 01:50 AM   #4
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Thanks. I can work around it for now with a post-conversion tweak.

Last edited by Agama; 07-20-2011 at 01:27 PM.
Agama is offline   Reply With Quote
Old 07-20-2011, 01:27 PM   #5
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Update: I found a simple workaround. Use the alternate syntax, asterisks instead of underscores.

"*emphasis in quotes*"

It would still be nice to get this fixed sometime, but it's not urgent.
Agama is offline   Reply With Quote
Advert
Old 09-12-2011, 01:29 PM   #6
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Quote:
Originally Posted by user_none View Post
Enhancing Markdown input and output are high on my todo list. I will probably have time to start on it this weekend.

3 Sep : Bump Markdown input to use Python Markdown version 2.0
I have now tried calibre 0.8.18 with Markdown input version 2.0 but the problem remains. Example ePub output attached, (with markdown source text included as <pre> formatted text.)

Sorry it's a forum posting rather than a PM but I couldn't work out how to attach the file to a PM.
Attached Files
File Type: epub MDTest1.epub (2.5 KB, 157 views)
Agama is offline   Reply With Quote
Old 09-12-2011, 01:31 PM   #7
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
I'll look into it.
user_none is offline   Reply With Quote
Old 09-18-2011, 06:56 PM   #8
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
The issue it was running into is the input parser is unable to tell the difference between "_test_" and this_or_that. It's hard to tell (nearly impossible) if the _ in a word should be kept or converted to a style. I've changed the input parser to always convert sets of _ to styles. If you want to keep mid word _'s they will need be be escaped as \_.
user_none is offline   Reply With Quote
Old 09-19-2011, 01:46 AM   #9
Dopedangel
Wizard
Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.
 
Dopedangel's Avatar
 
Posts: 1,759
Karma: 30063305
Join Date: Dec 2006
Location: Singapore
Device: Boyue
Does calibre process textz and txt files differently. I had a problem recently where with the textz file marking was not detected correctly where as using the txt file worked.
Sadly I was converting for someone so I deleted the files once I sent them to her. I will try to find something like it again and post.
Dopedangel is offline   Reply With Quote
Old 09-19-2011, 07:39 AM   #10
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
@Dopedangel, It processes TXT and TXTZ the same. Most likely what you're seeing is a failure to auto detect the formatting and structure of the file. In some cases you need to manually set these.
user_none is offline   Reply With Quote
Old 09-20-2011, 03:12 PM   #11
Agama
Guru
Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.Agama ought to be getting tired of karma fortunes by now.
 
Agama's Avatar
 
Posts: 776
Karma: 2751519
Join Date: Jul 2010
Location: UK
Device: PW2, Nexus7
Quote:
Originally Posted by user_none View Post
The issue it was running into is the input parser is unable to tell the difference between "_test_" and this_or_that. It's hard to tell (nearly impossible) if the _ in a word should be kept or converted to a style. I've changed the input parser to always convert sets of _ to styles. If you want to keep mid word _'s they will need be be escaped as \_.
Thanks. I'll test it when the release comes out.

(I would expect this_or_that to convert to this<em>or</em>that during Markdown processing, because the underscores are not escaped.)
Agama is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML/CSS for (German) s p a c e d o u t emphasis frabjous Workshop 21 05-16-2011 04:52 PM
->Txt+Markdown Perkin Calibre 2 12-11-2010 04:04 AM
Emphasis or Italic for Language ghostyjack Workshop 3 11-02-2010 10:46 AM
Calibre loses all forms of Emphasis spa Calibre 8 11-01-2010 06:06 AM
Emphasis Line and Emphasis Dot mcortez Sony Reader 6 01-19-2008 07:19 PM


All times are GMT -4. The time now is 11:53 AM.


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