We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b2dd89 commit 0970cebCopy full SHA for 0970ceb
1 file changed
src/ocrmypdf/hocrtransform/_hocr.py
@@ -263,9 +263,13 @@ def to_pdf(
263
264
def _get_text_direction(self, par):
265
"""Get the text direction of the paragraph.
266
-
+
267
Arabic, Hebrew, Persian, are right-to-left languages.
268
+ When the paragraph element is None, defaults to left-to-right.
269
"""
270
+ if par is None:
271
+ return TextDirection.LTR
272
273
return (
274
TextDirection.RTL
275
if par.attrib.get('dir', 'ltr') == 'rtl'
0 commit comments