Fix replacer error on patches with empty Runs (#2875)

* Add test to demonstrate empty strings not creating runs

* Fix Run not creating Text child for empty strings

* Simplify TextRun constructor

Since `Run` already has a option for instantiating a `Text` element, we don't need to push children here.

* Add replacer test for empty runs

* Add replacer test for empty runs

* replacer: handle patches with empty runs

* Fix incorrect test name
This commit is contained in:
SebKranz
2024-12-03 12:25:22 +01:00
committed by GitHub
parent 64505a295f
commit b89b571c4e
5 changed files with 78 additions and 11 deletions

View File

@ -155,7 +155,7 @@ export class Run extends XmlComponent {
this.root.push(child);
}
} else if (options.text) {
} else if (options.text !== undefined) {
this.root.push(new Text(options.text));
}
}