mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-29 21:44:32 +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
|
||||
)
|
||||
elif "Heading" in p_style_id:
|
||||
is_numbered_style = (
|
||||
"<w:numPr>" in paragraph.style.element.xml
|
||||
or "<w:numPr>" in paragraph._element.xml
|
||||
)
|
||||
style_element = getattr(paragraph.style, "element", None)
|
||||
if style_element:
|
||||
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)
|
||||
|
||||
elif len(equations) > 0:
|
||||
|
Loading…
Reference in New Issue
Block a user