From 0157e2fa3eac693a18db5812c611d2a7855be4ad Mon Sep 17 00:00:00 2001 From: Moses Paul R Date: Tue, 19 Nov 2024 21:40:23 +0000 Subject: [PATCH] fixes and cleanup --- marker/v2/processors/sectionheader.py | 2 +- marker/v2/schema/blocks/inlinemath.py | 6 +++--- marker/v2/schema/blocks/text.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/marker/v2/processors/sectionheader.py b/marker/v2/processors/sectionheader.py index ea9cc744..8cfac4ee 100644 --- a/marker/v2/processors/sectionheader.py +++ b/marker/v2/processors/sectionheader.py @@ -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) diff --git a/marker/v2/schema/blocks/inlinemath.py b/marker/v2/schema/blocks/inlinemath.py index b6316413..be37658b 100644 --- a/marker/v2/schema/blocks/inlinemath.py +++ b/marker/v2/schema/blocks/inlinemath.py @@ -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"

{template}

" + class_attr = " class='has-continuation'" + return f"

{template}

" diff --git a/marker/v2/schema/blocks/text.py b/marker/v2/schema/blocks/text.py index 2446349d..224b7b27 100644 --- a/marker/v2/schema/blocks/text.py +++ b/marker/v2/schema/blocks/text.py @@ -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"

{template}

" + return f"

{template}

"