Preserve semantic note layouts and checkpoint on provider quota failures
This commit is contained in:
@@ -20,6 +20,8 @@ def fixture(tmp_path):
|
||||
chapter.content = '''<html><head></head><body><h2 id="ch1"><span class="line">1</span>
|
||||
<span class="subtitle">ROOTS</span></h2><p id="opening" class="noindent" style="text-indent:0 !important; color:red">Opening prose.</p>
|
||||
<p id="caption" class="caption">A caption.</p><blockquote><p id="quote">Quoted text.</p></blockquote>
|
||||
<div role="doc-credits"><p id="credit" style="text-indent:0 !important">1: Photo credit.</p></div>
|
||||
<p role="doc-endnote" id="semantic-note" style="text-indent:0 !important">A semantic endnote.</p>
|
||||
<p id="second">Second paragraph.<a epub:type="noteref" href="notes.xhtml#note">1</a></p></body></html>'''
|
||||
part = epub.EpubHtml(uid='part', file_name='Text/part.xhtml', title='Part 1')
|
||||
part.content = '<html><body><h1 id="part"><span>PART 1</span><br/><em>BOY GENIUS</em></h1></body></html>'
|
||||
@@ -84,9 +86,11 @@ def test_headings_nav_ncx_contents_share_translation_and_keep_links(tmp_path,mod
|
||||
p=ch.find(attrs={'data-translation-for':key}) if mode=='bilingual' else ch.find(id=key)
|
||||
assert p['data-translation-role']=='body'
|
||||
assert 'text-indent' not in p.get('style','')
|
||||
for key in ['caption','quote']:
|
||||
for key in ['caption','quote','credit','semantic-note']:
|
||||
p=ch.find(attrs={'data-translation-for':key}) if mode=='bilingual' else ch.find(id=key)
|
||||
assert p['data-translation-role']=='other'
|
||||
if key in {'credit','semantic-note'}:
|
||||
assert 'text-indent:0 !important' in p['style']
|
||||
notes=BeautifulSoup(after.read(prefix+'Text/notes.xhtml'),'html.parser')
|
||||
assert notes.find(id='note') and notes.find('a',href='ch.xhtml#second')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user