0.0.233 (#417)
* fix: level reader * fix: level reader to read rpr * 0.0.233 * fix: defs * fix: changelogmain
parent
e1bd606480
commit
515812ffc8
|
@ -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/),
|
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).
|
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)
|
## docx-wasm@0.0.231 (19. January, 2022)
|
||||||
|
|
||||||
- Fixed a pPr reader.
|
- Fixed a pPr reader.
|
||||||
|
|
|
@ -14,6 +14,8 @@ impl ElementReader for Level {
|
||||||
) -> Result<Self, ReaderError> {
|
) -> Result<Self, ReaderError> {
|
||||||
let level = read_indent_level(attrs)?;
|
let level = read_indent_level(attrs)?;
|
||||||
let mut style_id = None;
|
let mut style_id = None;
|
||||||
|
let mut ppr = ParagraphProperty::new();
|
||||||
|
let mut rpr = RunProperty::new();
|
||||||
let mut start = Start::default();
|
let mut start = Start::default();
|
||||||
let mut num_fmt = NumberFormat::new("decimal");
|
let mut num_fmt = NumberFormat::new("decimal");
|
||||||
let mut level_text = LevelText::new("");
|
let mut level_text = LevelText::new("");
|
||||||
|
@ -39,6 +41,18 @@ impl ElementReader for Level {
|
||||||
let id = attributes[0].value.clone();
|
let id = attributes[0].value.clone();
|
||||||
style_id = Some(id);
|
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 => {
|
XMLElement::Start => {
|
||||||
start = Start::new(usize::from_str(&attributes[0].value)?);
|
start = Start::new(usize::from_str(&attributes[0].value)?);
|
||||||
}
|
}
|
||||||
|
@ -81,6 +95,8 @@ impl ElementReader for Level {
|
||||||
if has_indent {
|
if has_indent {
|
||||||
l = l.indent(indent_start, special_indent, indent_end, start_chars);
|
l = l.indent(indent_start, special_indent, indent_end, start_chars);
|
||||||
}
|
}
|
||||||
|
l.paragraph_property = ppr;
|
||||||
|
l.run_property = rpr;
|
||||||
l.level_restart = level_restart;
|
l.level_restart = level_restart;
|
||||||
return Ok(l);
|
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
|
@ -1,4 +1,5 @@
|
||||||
import { ParagraphPropertyJSON } from "./paragraph";
|
import { ParagraphPropertyJSON } from "./paragraph";
|
||||||
|
import { RunPropertyJSON } from "./run";
|
||||||
|
|
||||||
export type LevelJSON = {
|
export type LevelJSON = {
|
||||||
level: number;
|
level: number;
|
||||||
|
@ -8,6 +9,7 @@ export type LevelJSON = {
|
||||||
jc: string;
|
jc: string;
|
||||||
suffix: "tab" | "nothing" | "space";
|
suffix: "tab" | "nothing" | "space";
|
||||||
paragraphProperty: ParagraphPropertyJSON;
|
paragraphProperty: ParagraphPropertyJSON;
|
||||||
|
runProperty: RunPropertyJSON;
|
||||||
pstyle: string | null;
|
pstyle: string | null;
|
||||||
levelRestart: number | null;
|
levelRestart: number | null;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "docx-wasm",
|
"name": "docx-wasm",
|
||||||
"version": "0.0.231",
|
"version": "0.0.234",
|
||||||
"main": "dist/node/index.js",
|
"main": "dist/node/index.js",
|
||||||
"browser": "dist/web/index.js",
|
"browser": "dist/web/index.js",
|
||||||
"author": "bokuweb <bokuweb12@gmail.com>",
|
"author": "bokuweb <bokuweb12@gmail.com>",
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue