Fix edition font UUID rebinding and Protocols translation layout
This commit is contained in:
@@ -315,3 +315,15 @@ def test_nested_toc_anchor_binds_heading_and_normalizes_visible_ordinal():
|
||||
# A nested anchor in ordinary prose must still not become a title.
|
||||
assert not _headings(parse_html('<p><a id="prose">A sentence.</a></p>'),
|
||||
'chapter.xhtml#prose', 'Chapter 1. Obsession')[0]
|
||||
|
||||
|
||||
def test_graphical_title_binds_using_alt_without_mutating_image():
|
||||
from src.common.html import parse_html
|
||||
from src.preprocessing.navigation import _headings
|
||||
soup = parse_html('<section id="ch"><h1 id="heading">CHAPTER 1'
|
||||
'<span><img src="word.jpeg" alt="Protocols."/></span>'
|
||||
'<span><i>for</i> SLEEP</span></h1></section>')
|
||||
before = str(soup)
|
||||
headings, reason = _headings(soup, 'ch.xhtml#ch', 'Chapter 1: Protocols for Sleep')
|
||||
assert reason is None and [h['id'] for h in headings] == ['heading']
|
||||
assert str(soup) == before
|
||||
|
||||
Reference in New Issue
Block a user