mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-31 14:34:40 +00:00
Add style check
Signed-off-by: Rafael Teixeira de Lima <Rafael.td.lima@gmail.com>
This commit is contained in:
parent
ce7760f4a1
commit
8875e5d581
@ -347,10 +347,13 @@ class MsWordDocumentBackend(DeclarativeDocumentBackend):
|
|||||||
parent=None, label=DocItemLabel.TITLE, text=text
|
parent=None, label=DocItemLabel.TITLE, text=text
|
||||||
)
|
)
|
||||||
elif "Heading" in p_style_id:
|
elif "Heading" in p_style_id:
|
||||||
is_numbered_style = (
|
style_element = getattr(paragraph.style, "element", None)
|
||||||
"<w:numPr>" in paragraph.style.element.xml
|
if style_element:
|
||||||
or "<w:numPr>" in paragraph._element.xml
|
is_numbered_style = (
|
||||||
)
|
"<w:numPr>" in style_element.xml or "<w:numPr>" in element.xml
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
is_numbered_style = False
|
||||||
self.add_header(doc, p_level, text, is_numbered_style)
|
self.add_header(doc, p_level, text, is_numbered_style)
|
||||||
|
|
||||||
elif len(equations) > 0:
|
elif len(equations) > 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user