mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/unkn0w7n/calibre
This commit is contained in:
commit
8b5fbe73b3
@ -48,11 +48,21 @@ def parse_body(item):
|
||||
if item.get('type') == 'inline':
|
||||
if c.get('cmsType') == 'listicle':
|
||||
if 'title' in c:
|
||||
yield '<h3>' + escape(c['title']) + "</h3>"
|
||||
yield '<h3>' + escape(c['title']) + '</h3>'
|
||||
yield c['text']
|
||||
elif c.get('cmsType') == 'image':
|
||||
for line in parse_lead_image(c):
|
||||
yield line
|
||||
elif c.get('cmsType') == 'imagegroup':
|
||||
for imgs in c['images']:
|
||||
for line in parse_lead_image(imgs):
|
||||
yield line
|
||||
elif c.get('cmsType') == 'pullquote':
|
||||
if 'quote' in c:
|
||||
yield '<blockquote>' + c['quote'] + '</blockquote>'
|
||||
elif c.get('cmsType') == 'editorsNote':
|
||||
if 'note' in c:
|
||||
yield '<blockquote>' + c['note'] + '</blockquote>'
|
||||
else:
|
||||
if c['mrkup'].strip().startswith('<'):
|
||||
yield c['mrkup']
|
||||
@ -87,6 +97,10 @@ def article_parse(data):
|
||||
continue
|
||||
for mod in frm.get('mods', ()):
|
||||
for edg in mod.get('edgs', ()):
|
||||
if edg.get('cmsType') == 'ImmersiveLeadTile':
|
||||
if 'image' in edg.get('cmsImage', {}):
|
||||
for line in parse_lead_image(edg['cmsImage']):
|
||||
yield line
|
||||
if edg.get('cmsType') == 'ArticleBodyTile':
|
||||
for line in parse_article(edg):
|
||||
yield line
|
||||
|
@ -47,11 +47,21 @@ def parse_body(item):
|
||||
if item.get('type') == 'inline':
|
||||
if c.get('cmsType') == 'listicle':
|
||||
if 'title' in c:
|
||||
yield '<h3>' + escape(c['title']) + "</h3>"
|
||||
yield '<h3>' + escape(c['title']) + '</h3>'
|
||||
yield c['text']
|
||||
elif c.get('cmsType') == 'image':
|
||||
for line in parse_lead_image(c):
|
||||
yield line
|
||||
elif c.get('cmsType') == 'imagegroup':
|
||||
for imgs in c['images']:
|
||||
for line in parse_lead_image(imgs):
|
||||
yield line
|
||||
elif c.get('cmsType') == 'pullquote':
|
||||
if 'quote' in c:
|
||||
yield '<blockquote>' + c['quote'] + '</blockquote>'
|
||||
elif c.get('cmsType') == 'editorsNote':
|
||||
if 'note' in c:
|
||||
yield '<blockquote>' + c['note'] + '</blockquote>'
|
||||
else:
|
||||
if c['mrkup'].strip().startswith('<'):
|
||||
yield c['mrkup']
|
||||
@ -86,6 +96,10 @@ def article_parse(data):
|
||||
continue
|
||||
for mod in frm.get('mods', ()):
|
||||
for edg in mod.get('edgs', ()):
|
||||
if edg.get('cmsType') == 'ImmersiveLeadTile':
|
||||
if 'image' in edg.get('cmsImage', {}):
|
||||
for line in parse_lead_image(edg['cmsImage']):
|
||||
yield line
|
||||
if edg.get('cmsType') == 'ArticleBodyTile':
|
||||
for line in parse_article(edg):
|
||||
yield line
|
||||
|
@ -49,11 +49,21 @@ def parse_body(item):
|
||||
if item.get('type') == 'inline':
|
||||
if c.get('cmsType') == 'listicle':
|
||||
if 'title' in c:
|
||||
yield '<h3>' + escape(c['title']) + "</h3>"
|
||||
yield '<h3>' + escape(c['title']) + '</h3>'
|
||||
yield c['text']
|
||||
elif c.get('cmsType') == 'image':
|
||||
for line in parse_lead_image(c):
|
||||
yield line
|
||||
elif c.get('cmsType') == 'imagegroup':
|
||||
for imgs in c['images']:
|
||||
for line in parse_lead_image(imgs):
|
||||
yield line
|
||||
elif c.get('cmsType') == 'pullquote':
|
||||
if 'quote' in c:
|
||||
yield '<blockquote>' + c['quote'] + '</blockquote>'
|
||||
elif c.get('cmsType') == 'editorsNote':
|
||||
if 'note' in c:
|
||||
yield '<blockquote>' + c['note'] + '</blockquote>'
|
||||
else:
|
||||
if c['mrkup'].strip().startswith('<'):
|
||||
yield c['mrkup']
|
||||
@ -88,6 +98,10 @@ def article_parse(data):
|
||||
continue
|
||||
for mod in frm.get('mods', ()):
|
||||
for edg in mod.get('edgs', ()):
|
||||
if edg.get('cmsType') == 'ImmersiveLeadTile':
|
||||
if 'image' in edg.get('cmsImage', {}):
|
||||
for line in parse_lead_image(edg['cmsImage']):
|
||||
yield line
|
||||
if edg.get('cmsType') == 'ArticleBodyTile':
|
||||
for line in parse_article(edg):
|
||||
yield line
|
||||
|
Loading…
x
Reference in New Issue
Block a user