Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix negative ref_dif causing incorrect paragraph splitting #288

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix negative ref_dif causing incorrect paragraph splitting
  • Loading branch information
tehwenyi committed May 6, 2024
commit ae7f9bde9e9ee9d6f97a5032e080509f73e40abe
2 changes: 1 addition & 1 deletion pdf2docx/layout/Blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def common_vertical_spacing():
y0, y1 = get_v_bdy(block)
distances.append(round(y0-ref1, 2))
ref0, ref1 = y0, y1
return max(distances, key=distances.count) if distances else 0.0
return max(max(distances, key=distances.count), 0.0) if distances else 0.0

# create text block based on lines
blocks = [] # type: list[TextBlock]
Expand Down