* fix: level reader

* fix: level reader to read rpr

* 0.0.233

* fix: defs

* fix: changelog
main
bokuweb 2022-01-23 00:58:42 +09:00 committed by GitHub
parent e1bd606480
commit 515812ffc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 735 additions and 117 deletions

View File

@ -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.232, 0.0.233, 0.0.234 (24. January, 2022)
- Fixed a level reader to read paragraphProperty and runProperty
## docx-wasm@0.0.231 (19. January, 2022)
- Fixed a pPr reader.

View File

@ -14,6 +14,8 @@ impl ElementReader for Level {
) -> Result<Self, ReaderError> {
let level = read_indent_level(attrs)?;
let mut style_id = None;
let mut ppr = ParagraphProperty::new();
let mut rpr = RunProperty::new();
let mut start = Start::default();
let mut num_fmt = NumberFormat::new("decimal");
let mut level_text = LevelText::new("");
@ -39,6 +41,18 @@ impl ElementReader for Level {
let id = attributes[0].value.clone();
style_id = Some(id);
}
XMLElement::ParagraphProperty => {
if let Ok(pr) = ParagraphProperty::read(r, attrs) {
ppr = pr;
}
continue;
}
XMLElement::RunProperty => {
if let Ok(pr) = RunProperty::read(r, attrs) {
rpr = pr;
}
continue;
}
XMLElement::Start => {
start = Start::new(usize::from_str(&attributes[0].value)?);
}
@ -81,6 +95,8 @@ impl ElementReader for Level {
if has_indent {
l = l.indent(indent_start, special_indent, indent_end, start_chars);
}
l.paragraph_property = ppr;
l.run_property = rpr;
l.level_restart = level_restart;
return Ok(l);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,5 @@
import { ParagraphPropertyJSON } from "./paragraph";
import { RunPropertyJSON } from "./run";
export type LevelJSON = {
level: number;
@ -8,6 +9,7 @@ export type LevelJSON = {
jc: string;
suffix: "tab" | "nothing" | "space";
paragraphProperty: ParagraphPropertyJSON;
runProperty: RunPropertyJSON;
pstyle: string | null;
levelRestart: number | null;
};

View File

@ -1,6 +1,6 @@
{
"name": "docx-wasm",
"version": "0.0.231",
"version": "0.0.234",
"main": "dist/node/index.js",
"browser": "dist/web/index.js",
"author": "bokuweb <bokuweb12@gmail.com>",

File diff suppressed because it is too large Load Diff