Skip to content

Commit

Permalink
Fix span id issue
Browse files Browse the repository at this point in the history
  • Loading branch information
VikParuchuri committed Jan 24, 2025
1 parent d3c43d6 commit 2f14c52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions marker/renderers/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ def convert_table(self, el, text, convert_as_inline):
def convert_a(self, el, text, convert_as_inline):
text = self.escape(text)
text = re.sub(r"([\[\]])", r"\\\1", text)
return super().convert_a(el, self.escape(text), convert_as_inline)
return super().convert_a(el, text, convert_as_inline)

def convert_span(self, el, text, convert_as_inline):
return f'<span id="{el["id"]}"/>'

if el.get("id"):
return f'<span id="{el["id"]}">{text}</span>'
else:
return text

class MarkdownOutput(BaseModel):
markdown: str
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "marker-pdf"
version = "1.3.1"
version = "1.3.2"
description = "Convert PDF to markdown with high speed and accuracy."
authors = ["Vik Paruchuri <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 2f14c52

Please sign in to comment.