Make prettified XML a Packer-wide configurable option

The xml() function was being passed a flag for pretty printing the XML in word/document.xml. This was causing some parsers (not Word itself) to break when they didn't expect whitepsace. It was also causing some files to be prettified and others to be ugly. This ensures consistent prettification.
This commit is contained in:
Mark Charyk
2019-06-20 15:59:43 -07:00
parent 58dc6fe389
commit 72c32378c5
2 changed files with 21 additions and 19 deletions

View File

@ -4,8 +4,8 @@ import { Compiler } from "./next-compiler";
export class Packer {
private readonly compiler: Compiler;
constructor() {
this.compiler = new Compiler();
constructor(prettifyXml?: boolean) {
this.compiler = new Compiler(prettifyXml);
}
public async toBuffer(file: File): Promise<Buffer> {