From c225bc3f3dbe5c001e8fec119d8f8dadf96ec95b Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 3 Jul 2016 19:57:37 +0100 Subject: Return root element directly when reading XML --- lib/docx/comments-reader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/docx/comments-reader.js') diff --git a/lib/docx/comments-reader.js b/lib/docx/comments-reader.js index 41bf8f6..725fdb4 100644 --- a/lib/docx/comments-reader.js +++ b/lib/docx/comments-reader.js @@ -2,8 +2,8 @@ var documents = require("../documents"); var Result = require("../results").Result; function createCommentsReader(bodyReader) { - function readCommentsXml(xml) { - return Result.combine(xml.root.getElementsByTagName("w:comment") + function readCommentsXml(element) { + return Result.combine(element.getElementsByTagName("w:comment") .map(readCommentElement)); } -- cgit v1.2.3