From 75290aeaf5ed04bb00f4df3777468d466bc4a775 Mon Sep 17 00:00:00 2001 From: Andrey Savin Date: Thu, 16 Sep 2021 13:03:34 +0300 Subject: [PATCH] Adding numberingReplacer for styles.xml at next-compiler.ts --- src/export/packer/next-compiler.ts | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/export/packer/next-compiler.ts b/src/export/packer/next-compiler.ts index 3311301a61..24cf9d3186 100644 --- a/src/export/packer/next-compiler.ts +++ b/src/export/packer/next-compiler.ts @@ -123,19 +123,23 @@ export class Compiler { path: "word/document.xml", }, Styles: { - data: xml( - this.formatter.format(file.Styles, { - viewWrapper: file.Document, - file, - }), - { - indent: prettify, - declaration: { - standalone: "yes", - encoding: "UTF-8", + data: (() => { + const xmlStyles = xml( + this.formatter.format(file.Styles, { + viewWrapper: file.Document, + file, + }), + { + indent: prettify, + declaration: { + standalone: "yes", + encoding: "UTF-8", + }, }, - }, - ), + ); + const referencedXmlStyles = this.numberingReplacer.replace(xmlStyles, file.Numbering.ConcreteNumbering); + return referencedXmlStyles; + })(), path: "word/styles.xml", }, Properties: {