diff --git a/CHANGELOG.md b/CHANGELOG.md index 438a00c..49ceeef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## docx-wasm@0.0.276-rc12 (26. Aug, 2022) + +- [BugFix] Fixed a bug, hRule is not read in reader. + ## docx-wasm@0.0.276-rc11 (25. Aug, 2022) - [Breaking] change table row `hightRule` to `auto` in reader. diff --git a/docx-core/src/reader/table_row.rs b/docx-core/src/reader/table_row.rs index 3aa9d23..3803f9f 100644 --- a/docx-core/src/reader/table_row.rs +++ b/docx-core/src/reader/table_row.rs @@ -55,13 +55,6 @@ impl ElementReader for TableRow { width_before = Some(v.0 as f32); } } - XMLElement::HeightRule => { - if let Some(v) = read_val(&attributes) { - if let Ok(r) = HeightRule::from_str(&v) { - height_rule = Some(r); - } - } - } XMLElement::TableRowHeight => { if let Some(v) = read_val(&attributes) { let h = f32::from_str(&v); @@ -69,6 +62,13 @@ impl ElementReader for TableRow { row_height = Some(h); } } + + if let Some(v) = read(&attributes, "hRule") { + let h = HeightRule::from_str(&v); + if let Ok(h) = h { + height_rule = Some(h); + } + } } XMLElement::Delete => { if let Ok(d) = Delete::read(r, &attributes) { diff --git a/docx-wasm/package.json b/docx-wasm/package.json index 165d989..534e63e 100644 --- a/docx-wasm/package.json +++ b/docx-wasm/package.json @@ -1,6 +1,6 @@ { "name": "docx-wasm", - "version": "0.0.276-rc11", + "version": "0.0.276-rc12", "main": "dist/node/index.js", "browser": "dist/web/index.js", "author": "bokuweb ", diff --git a/docx-wasm/test/__snapshots__/index.test.js.snap b/docx-wasm/test/__snapshots__/index.test.js.snap index 904ef82..b73a15e 100644 --- a/docx-wasm/test/__snapshots__/index.test.js.snap +++ b/docx-wasm/test/__snapshots__/index.test.js.snap @@ -8583,7 +8583,7 @@ Object { "property": Object { "gridAfter": 1, "gridBefore": null, - "heightRule": "auto", + "heightRule": "exact", "rowHeight": 55, "widthAfter": 1065, "widthBefore": null, @@ -8933,7 +8933,7 @@ Object { "property": Object { "gridAfter": 2, "gridBefore": null, - "heightRule": "auto", + "heightRule": "exact", "rowHeight": 397, "widthAfter": 3717, "widthBefore": null, @@ -9107,7 +9107,7 @@ Object { "property": Object { "gridAfter": 2, "gridBefore": null, - "heightRule": "auto", + "heightRule": "exact", "rowHeight": 397, "widthAfter": 3717, "widthBefore": null, @@ -9360,7 +9360,7 @@ Object { "property": Object { "gridAfter": 2, "gridBefore": null, - "heightRule": "auto", + "heightRule": "exact", "rowHeight": 397, "widthAfter": 3717, "widthBefore": null, @@ -9613,7 +9613,7 @@ Object { "property": Object { "gridAfter": 2, "gridBefore": null, - "heightRule": "auto", + "heightRule": "exact", "rowHeight": 397, "widthAfter": 3717, "widthBefore": null, @@ -9854,7 +9854,7 @@ Object { "property": Object { "gridAfter": 2, "gridBefore": null, - "heightRule": "auto", + "heightRule": "exact", "rowHeight": 397, "widthAfter": 3717, "widthBefore": null, @@ -10107,7 +10107,7 @@ Object { "property": Object { "gridAfter": 2, "gridBefore": null, - "heightRule": "auto", + "heightRule": "exact", "rowHeight": 397, "widthAfter": 3717, "widthBefore": null,