fnp
/
librarian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Only write translators on cover if they fit.
[librarian.git]
/
src
/
librarian
/
html.py
diff --git
a/src/librarian/html.py
b/src/librarian/html.py
index
f0f11db
..
fddeb2f
100644
(file)
--- a/
src/librarian/html.py
+++ b/
src/librarian/html.py
@@
-114,7
+114,8
@@
def transform(wldoc, stylesheet='legacy', options=None, flags=None, css=None, ga
document.clean_ed_note()
document.clean_ed_note('abstrakt')
document.clean_ed_note()
document.clean_ed_note('abstrakt')
-
+ document.fix_pa_akap()
+
if not options:
options = {}
if not options:
options = {}
@@
-311,6
+312,7
@@
def any_ancestor(element, test):
def add_anchors(root):
counter = 1
def add_anchors(root):
counter = 1
+ visible_counter = 1
for element in root.iterdescendants():
def f(e):
return (
for element in root.iterdescendants():
def f(e):
return (
@@
-319,17
+321,27
@@
def add_anchors(root):
)
or e.get('id') == 'nota_red'
or e.tag == 'blockquote'
)
or e.get('id') == 'nota_red'
or e.tag == 'blockquote'
+ or e.get('id') == 'footnotes'
)
)
+
+ if element.get('class') == 'numeracja':
+ try:
+ visible_counter = int(element.get('data-start'))
+ except ValueError:
+ visible_counter = 1
+
if any_ancestor(element, f):
continue
if element.tag == 'div' and 'verse' in element.get('class', ''):
if any_ancestor(element, f):
continue
if element.tag == 'div' and 'verse' in element.get('class', ''):
- if
counter == 1 or
counter % 5 == 0:
- add_anchor(element, "f%d" % counter, link_text=counter)
+ if
visible_counter == 1 or visible_
counter % 5 == 0:
+ add_anchor(element, "f%d" % counter, link_text=
visible_
counter)
counter += 1
counter += 1
+ visible_counter += 1
elif 'paragraph' in element.get('class', ''):
elif 'paragraph' in element.get('class', ''):
- add_anchor(element, "f%d" % counter, link_text=counter)
+ add_anchor(element, "f%d" % counter, link_text=
visible_
counter)
counter += 1
counter += 1
+ visible_counter += 1
def raw_printable_text(element):
def raw_printable_text(element):