You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Tim Allison (Jira)" <ji...@apache.org> on 2021/11/29 20:09:00 UTC

[jira] [Commented] (TIKA-2781) Numbering is removed from headings when converting docx

    [ https://issues.apache.org/jira/browse/TIKA-2781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17450702#comment-17450702 ] 

Tim Allison commented on TIKA-2781:
-----------------------------------

I spent a bit of time looking over this today.  This will require a fairly significant rewrite of list number handling for docx.  The main issue is that numbering is based on the abstract number id, except that concrete numbers may have their own startOverrides, which means that we'll have to keep track of list numbers for both the abstractnumbers and the concrete numbers.

To quote the example from the spec:
{noformat}
<w:num w:numId="5">
<w:abstractNumId w:val="4"/>
</w:num>
<w:num w:numId="6">
<w:abstractNumId w:val="4"/>
<w:lvlOverride w:ilvl="0">
<w:startOverride w:val = "1"/>
</w:lvlOverride>
{noformat}

this will say, take the counter for the abstract number 4, and reset it for numid6.  The default behavior would be to continue to increment it for any concrete numbers extending abstract number 4 (at the appropriate level, etc.).

During this investigation, I also found that we're not handling multiLevelType  (e.g. {{<w:multiLevelType w:val="singleLevel"/>}}) at all.

When we revamp list handling in docx, we should add handling for that.

Between our current unit tests and the documents attached here, we have all the raw materials we need...but this will not be a small amount of work to get right.

> Numbering is removed from headings when converting docx
> -------------------------------------------------------
>
>                 Key: TIKA-2781
>                 URL: https://issues.apache.org/jira/browse/TIKA-2781
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.19.1
>            Reporter: Madhav Bhagat
>            Priority: Minor
>         Attachments: Test-Numbering-MultipleLevels.docx, test numbering (1).docx
>
>
> When converting a docx file with numbering in headings, TIKA ignores said numbering and only returns the text. We have are investigating and working on a fix (along with a test) and wanted to know if this is going to be accepted.
> Example of failing test file is attached.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)