Skip to content

Commit 6a1c901

Browse files
committed
ed-home-convert: use head level ( knaw-huc/textannoviz#578 )
1 parent 80bc4ab commit 6a1c901

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

editem_apparatus/home_handler.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ def startElement(self, tag, attributes):
3636
self.close_tags[tag] = "</div>"
3737

3838
elif self.capture and tag == "head":
39-
self.html += "<h3>"
40-
self.close_tags[tag] = "</h3>"
39+
level = attributes["level"]
40+
self.html += f"<{level}>"
41+
self.close_tags[tag] = f"</{level}>"
4142

4243
elif self.capture and tag == "hi":
4344
rend = attributes["rend"]
@@ -86,7 +87,7 @@ def startElement(self, tag, attributes):
8687
else:
8788
if self.capture:
8889
self.unhandled_tags.add(tag)
89-
self.html += f"<!-- open {tag} {attributes.keys()} -->"
90+
# self.html += f"<!-- open {tag} {attributes.keys()} -->"
9091
self.parent_tag_stack.append(tag)
9192

9293
def endElement(self, tag):
@@ -99,10 +100,10 @@ def endElement(self, tag):
99100
if tag in self.close_tags:
100101
self.html += self.close_tags[tag]
101102
self.close_tags.pop(tag)
102-
else:
103-
# if self.close_tags:
104-
# ic(tag, self.close_tags)
105-
self.html += f"<!-- close {tag} -->\n"
103+
# else:
104+
# # if self.close_tags:
105+
# # ic(tag, self.close_tags)
106+
# self.html += f"<!-- close {tag} -->\n"
106107

107108
def characters(self, content):
108109
if self.capture:

0 commit comments

Comments
 (0)