From b6f431e14d5a36ba922232b3260f5b73dda1b65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mendon=C3=A7a?= Date: Sat, 20 Oct 2018 09:17:37 -0300 Subject: [PATCH] fixed TOC instruction that was missing quotes for some switches --- src/file/table-of-contents/field-instruction.ts | 10 +++++----- src/file/table-of-contents/table-of-contents.spec.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/file/table-of-contents/field-instruction.ts b/src/file/table-of-contents/field-instruction.ts index 766e6fc2f2..7194cf3f16 100644 --- a/src/file/table-of-contents/field-instruction.ts +++ b/src/file/table-of-contents/field-instruction.ts @@ -41,19 +41,19 @@ export class FieldInstruction extends XmlComponent { instruction = `${instruction} \\h`; } if (this.properties.tcFieldLevelRange) { - instruction = `${instruction} \\l "${this.properties.tcFieldLevelRange}`; + instruction = `${instruction} \\l "${this.properties.tcFieldLevelRange}"`; } if (this.properties.pageNumbersEntryLevelsRange) { - instruction = `${instruction} \\n "${this.properties.pageNumbersEntryLevelsRange}`; + instruction = `${instruction} \\n "${this.properties.pageNumbersEntryLevelsRange}"`; } if (this.properties.headingStyleRange) { - instruction = `${instruction} \\o "${this.properties.headingStyleRange}`; + instruction = `${instruction} \\o "${this.properties.headingStyleRange}"`; } if (this.properties.entryAndPageNumberSeparator) { - instruction = `${instruction} \\p "${this.properties.entryAndPageNumberSeparator}`; + instruction = `${instruction} \\p "${this.properties.entryAndPageNumberSeparator}"`; } if (this.properties.seqFieldIdentifierForPrefix) { - instruction = `${instruction} \\s "${this.properties.seqFieldIdentifierForPrefix}`; + instruction = `${instruction} \\s "${this.properties.seqFieldIdentifierForPrefix}"`; } if (this.properties.stylesWithLevels && this.properties.stylesWithLevels.length) { const styles = this.properties.stylesWithLevels.map((sl) => `${sl.styleName},${sl.level}`).join(","); diff --git a/src/file/table-of-contents/table-of-contents.spec.ts b/src/file/table-of-contents/table-of-contents.spec.ts index 7d7d4a55b6..6729f004ba 100644 --- a/src/file/table-of-contents/table-of-contents.spec.ts +++ b/src/file/table-of-contents/table-of-contents.spec.ts @@ -174,7 +174,7 @@ const COMPLETE_TOC = { "xml:space": "preserve", }, }, - 'TOC \\a "A" \\b "B" \\c "C" \\d "D" \\f "F" \\h \\l "L \\n "N \\o "O \\p "P \\s "S \\t "SL,1,SL,2" \\u \\w \\x \\z', + 'TOC \\a "A" \\b "B" \\c "C" \\d "D" \\f "F" \\h \\l "L" \\n "N" \\o "O" \\p "P" \\s "S" \\t "SL,1,SL,2" \\u \\w \\x \\z', ], }, {