mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-26 20:14:47 +00:00
Adding plain latex equations to table cells
Signed-off-by: Rafael Teixeira de Lima <Rafael.td.lima@gmail.com>
This commit is contained in:
parent
ec971bbe68
commit
ca8b7b0eef
@ -1104,8 +1104,17 @@ class MsWordDocumentBackend(DeclarativeDocumentBackend):
|
|||||||
)
|
)
|
||||||
_log.debug(f" spanned before row {spanned_idx}")
|
_log.debug(f" spanned before row {spanned_idx}")
|
||||||
|
|
||||||
|
# Detect equations in cell text
|
||||||
|
text, equations = self._handle_equations_in_text(
|
||||||
|
element=cell._element, text=cell.text
|
||||||
|
)
|
||||||
|
if len(equations) == 0:
|
||||||
|
text = cell.text
|
||||||
|
else:
|
||||||
|
text = text.replace("<eq>", "$").replace("</eq>", "$")
|
||||||
|
|
||||||
table_cell = TableCell(
|
table_cell = TableCell(
|
||||||
text=cell.text,
|
text=text,
|
||||||
row_span=spanned_idx - row_idx,
|
row_span=spanned_idx - row_idx,
|
||||||
col_span=cell.grid_span,
|
col_span=cell.grid_span,
|
||||||
start_row_offset_idx=row.grid_cols_before + row_idx,
|
start_row_offset_idx=row.grid_cols_before + row_idx,
|
||||||
|
Loading…
Reference in New Issue
Block a user