Skip to content

Commit

Permalink
fixes and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
iammosespaulr committed Nov 19, 2024
1 parent e9f8352 commit 0157e2f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion marker/v2/processors/sectionheader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __call__(self, document: Document):
if block.block_type not in self.block_types:
continue

line_heights[block.block_id] = [document.get_block(l).polygon.height for l in block.structure if l.block_type == BlockTypes.Line]
line_heights[block.block_id] = [document.get_block(l).polygon.height for l in block.structure if block.structure is not None and l.block_type == BlockTypes.Line]

flat_line_heights = [h for heights in line_heights.values() for h in heights]
heading_ranges = self.bucket_headings(flat_line_heights)
Expand Down
6 changes: 3 additions & 3 deletions marker/v2/schema/blocks/inlinemath.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def assemble_html(self, child_blocks, parent_structure):
template = super().assemble_html(child_blocks, parent_structure)
template = template.replace("\n", " ")

class_name = "text"
class_attr = ""
if self.has_continuation:
class_name += " _has-continuation"
return f"<p class='{class_name}'>{template}</p>"
class_attr = " class='has-continuation'"
return f"<p {class_attr}>{template}</p>"
2 changes: 1 addition & 1 deletion marker/v2/schema/blocks/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ def assemble_html(self, child_blocks, parent_structure):
class_attr = ""
if self.has_continuation:
class_attr += "class='has-continuation'"
return f"<p {class_attr}'>{template}</p>"
return f"<p {class_attr}>{template}</p>"

0 comments on commit 0157e2f

Please sign in to comment.