File tree Expand file tree Collapse file tree
packages/super-editor/src/core/super-converter/v2/importer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -544,12 +544,21 @@ function getNumberingDefinitions(docx) {
544544 abstractDefinitions [ abstractId ] = el ;
545545 } ) ;
546546
547- const importListDefs = { } ;
547+ let importListDefs = { } ;
548548 definitions . forEach ( ( el ) => {
549549 const numId = Number ( el . attributes [ 'w:numId' ] ) ;
550550 importListDefs [ numId ] = el ;
551551 } ) ;
552552
553+ const listDefsEntries = Object . entries ( importListDefs ) ;
554+ const foundByDurableId = listDefsEntries . filter ( ( [ _id , def ] ) => def . attributes ?. [ 'w16cid:durableId' ] === '485517411' ) ;
555+ // To fix corrupted numbering.xml file.
556+ if ( foundByDurableId . length > 1 ) {
557+ importListDefs = Object . fromEntries (
558+ listDefsEntries . filter ( ( [ _id , def ] ) => def . attributes ?. [ 'w16cid:durableId' ] !== '485517411' )
559+ ) ;
560+ }
561+
553562 return {
554563 abstracts : abstractDefinitions ,
555564 definitions : importListDefs ,
You can’t perform that action at this time.
0 commit comments