el.elements not iterable when patching comments
bituq opened this issue · comments
Dylan N commented
It is currently not possible to add comment references or comment ranges when patching a document. Am I missing something?
let children = changes.map((change, index) => {
if (change.added) {
return new docx.InsertedTextRun({
text: change.value,
id: index,
author: "test",
date,
});
} else if (change.removed) {
return new docx.DeletedTextRun({
text: change.value,
id: index,
author: "test",
date,
});
} else {
return new docx.TextRun({
text: change.value,
});
}
});
patches[el.id] = {
type: docx.PatchType.PARAGRAPH,
children: [
...children,
new CommentReference(Number(commentId))
]
}
error message:
TypeError: e.elements is not iterable