Thread: HTML5 parsing
View Single Post
Old 08-08-2012, 05:42 PM   #7
nickredding
onlinenewsreader.net
nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'nickredding knows the difference between 'who' and 'whom'
 
Posts: 324
Karma: 10143
Join Date: Dec 2009
Location: Phoenix, AZ & Victoria, BC
Device: Kindle 3, Kindle Fire, IPad3, iPhone4, Playbook, HTC Inspire
Solution code

For anyone else having this issue, place the following code in your recipe:

Code:
from calibre.ebooks.BeautifulSoup import BeautifulSoup
    for x in ['article', 'aside', 'header', 'footer', 'nav', 'figcaption', 'figure', 'section']:
        BeautifulSoup.NESTABLE_BLOCK_TAGS.append(x)
        BeautifulSoup.RESET_NESTING_TAGS[x]=None
        BeautifulSoup.NESTABLE_TAGS[x]=[]
This will cause the HTML5 tags to be treated like DIVs by the parser (which is what they get replaced with later in the conversion process).
nickredding is offline   Reply With Quote