mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-26 20:14:47 +00:00
Initial analysis and fix for KeyError: 'fPr' in OMML fraction processing
Co-authored-by: cau-git <60343111+cau-git@users.noreply.github.com>
This commit is contained in:
parent
d02d2772db
commit
7bd828f121
@ -260,7 +260,12 @@ class oMath2Latex(Tag2Method):
|
|||||||
the fraction object
|
the fraction object
|
||||||
"""
|
"""
|
||||||
c_dict = self.process_children_dict(elm)
|
c_dict = self.process_children_dict(elm)
|
||||||
pr = c_dict["fPr"]
|
pr = c_dict.get("fPr")
|
||||||
|
if pr is None:
|
||||||
|
# Handle missing fPr element gracefully
|
||||||
|
_log.warning("Missing fPr element in fraction, using default formatting")
|
||||||
|
latex_s = F_DEFAULT
|
||||||
|
return latex_s.format(num=c_dict.get("num", "formula_skipped"), den=c_dict.get("den", "formula_skipped"))
|
||||||
latex_s = get_val(pr.type, default=F_DEFAULT, store=F)
|
latex_s = get_val(pr.type, default=F_DEFAULT, store=F)
|
||||||
return pr.text + latex_s.format(num=c_dict.get("num"), den=c_dict.get("den"))
|
return pr.text + latex_s.format(num=c_dict.get("num"), den=c_dict.get("den"))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user