From 6ad55330e1c1fbe2e88f899319cd1a789b126805 Mon Sep 17 00:00:00 2001 From: Albert Kisiel Date: Tue, 17 Nov 2020 15:30:37 +0100 Subject: [PATCH] prepend and append comment elements --- docx/oxml/text/run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docx/oxml/text/run.py b/docx/oxml/text/run.py index 489b28c86..8f3a9c70f 100644 --- a/docx/oxml/text/run.py +++ b/docx/oxml/text/run.py @@ -73,8 +73,8 @@ def link_comment(self, _id): rStart._id = _id rEnd = OxmlElement('w:commentRangeEnd') rEnd._id = _id - self.insert(0,rStart) - self.append(rEnd) + self.addprevious(rStart) + self.addnext(rEnd) def add_comment_reference(self, _id): reference = OxmlElement('w:commentReference')