escape bars

This commit is contained in:
Sergio Mendonça
2018-09-04 17:29:24 -03:00
parent e9a007d446
commit 7926f6c189
2 changed files with 6 additions and 6 deletions

View File

@ -37,20 +37,20 @@ export class TableOfContentsInstruction extends XmlComponent {
this.root.push(new TextAttributes({ space: "preserve" })); this.root.push(new TextAttributes({ space: "preserve" }));
let instruction = "TOC"; let instruction = "TOC";
if (this.properties.entriesFromSession) { if (this.properties.entriesFromSession) {
instruction = `${instruction} \b "${this.properties.entriesFromSession}"`; instruction = `${instruction} \\b "${this.properties.entriesFromSession}"`;
} }
if (this.properties.hiperlink) { if (this.properties.hiperlink) {
instruction = `${instruction} \h`; instruction = `${instruction} \\h`;
} }
if (this.properties.entryLevelsRange) { if (this.properties.entryLevelsRange) {
instruction = `${instruction} \n "${this.properties.entryLevelsRange}"`; instruction = `${instruction} \\n "${this.properties.entryLevelsRange}"`;
} }
if (this.properties.headerRange) { if (this.properties.headerRange) {
instruction = `${instruction} \o "${this.properties.headerRange}"`; instruction = `${instruction} \\o "${this.properties.headerRange}"`;
} }
if (this.properties.styles && this.properties.styles.length) { if (this.properties.styles && this.properties.styles.length) {
const styles = this.properties.styles.map((sl) => `${sl.styleName}, ${sl.level}`).join(", "); const styles = this.properties.styles.map((sl) => `${sl.styleName}, ${sl.level}`).join(", ");
instruction = `${instruction} \t "${styles}"`; instruction = `${instruction} \\t "${styles}"`;
} }
this.root.push(instruction); this.root.push(instruction);
} }

View File

@ -33,7 +33,7 @@ const DEFAULT_TOC = {
"xml:space": "preserve", "xml:space": "preserve",
}, },
}, },
'TOC \n "1-6"', 'TOC \\n "1-6"',
], ],
}, },
{ {