mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Style the notes header the same as the first header in the document
This commit is contained in:
parent
1edc4d9284
commit
8d234da162
@ -83,11 +83,13 @@ class Convert(object):
|
||||
p = self.convert_p(wp)
|
||||
self.body.append(p)
|
||||
|
||||
notes_header = None
|
||||
if self.footnotes.has_notes:
|
||||
dl = DL()
|
||||
dl.set('class', 'notes')
|
||||
self.body.append(H1(self.notes_text))
|
||||
self.body[-1].set('class', 'notes-header')
|
||||
notes_header = self.body[-1]
|
||||
notes_header.set('class', 'notes-header')
|
||||
self.body.append(dl)
|
||||
for anchor, text, note in self.footnotes:
|
||||
dl.append(DT('[', A('←' + text, href='#back_%s' % anchor, title=text), id=anchor))
|
||||
@ -135,6 +137,14 @@ class Convert(object):
|
||||
if cls:
|
||||
html_obj.set('class', cls)
|
||||
|
||||
if notes_header is not None:
|
||||
for h in self.body.iterchildren('h1', 'h2', 'h3'):
|
||||
notes_header.tag = h.tag
|
||||
cls = h.get('class', None)
|
||||
if cls and cls != 'notes-header':
|
||||
notes_header.set('class', '%s notes-header' % cls)
|
||||
break
|
||||
|
||||
self.write()
|
||||
|
||||
def read_page_properties(self, doc):
|
||||
|
Loading…
x
Reference in New Issue
Block a user