From 48142fbcedb6d9e30c93bf9bf0ecbbd38d07fcac Mon Sep 17 00:00:00 2001 From: bokuweb Date: Fri, 14 Aug 2020 02:11:20 +0900 Subject: [PATCH] 0.0.90 (#118) * update * fix: table comment * 0.2.5 * 0.0.90 --- Cargo.lock | 4 ++-- docx-core/Cargo.toml | 2 +- docx-core/src/documents/mod.rs | 18 ++++++++++++++++++ docx-wasm/package.json | 2 +- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index efc9861..74483a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -171,7 +171,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "docx-rs" -version = "0.2.3" +version = "0.2.5" dependencies = [ "image 0.23.8 (registry+https://github.com/rust-lang/crates.io-index)", "insta 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -188,7 +188,7 @@ dependencies = [ name = "docx-wasm" version = "0.1.0" dependencies = [ - "docx-rs 0.2.3", + "docx-rs 0.2.5", "wasm-bindgen 0.2.53 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-test 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/docx-core/Cargo.toml b/docx-core/Cargo.toml index e192ffa..4e143c9 100644 --- a/docx-core/Cargo.toml +++ b/docx-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "docx-rs" -version = "0.2.3" +version = "0.2.5" authors = ["bokuweb "] repository = "https://github.com/bokuweb/docx-rs" edition = "2018" diff --git a/docx-core/src/documents/mod.rs b/docx-core/src/documents/mod.rs index 274a814..3596c70 100644 --- a/docx-core/src/documents/mod.rs +++ b/docx-core/src/documents/mod.rs @@ -273,7 +273,25 @@ impl Docx { TableCellContent::Paragraph(paragraph) => { for child in ¶graph.children { if let ParagraphChild::CommentStart(c) = child { + let comment = c.comment(); + let para_id = comment.paragraph.id.clone(); comments.push(c.comment()); + let comment_extended = + CommentExtended::new(para_id); + if let Some(parent_comment_id) = + comment.parent_comment_id + { + let parent_para_id = comment_map + .get(&parent_comment_id) + .unwrap() + .clone(); + comments_extended.push( + comment_extended + .parent_paragraph_id(parent_para_id), + ); + } else { + comments_extended.push(comment_extended); + } } } } diff --git a/docx-wasm/package.json b/docx-wasm/package.json index 1b04b03..d32f74a 100644 --- a/docx-wasm/package.json +++ b/docx-wasm/package.json @@ -1,6 +1,6 @@ { "name": "docx-wasm", - "version": "0.0.87", + "version": "0.0.90", "main": "dist/node/index.js", "browser": "dist/web/index.js", "author": "bokuweb ",