parent
cd214fdaf5
commit
79841fca0c
|
@ -36,8 +36,9 @@ impl ElementReader for NumberingProperty {
|
||||||
let e = XMLElement::from_str(&name.local_name).unwrap();
|
let e = XMLElement::from_str(&name.local_name).unwrap();
|
||||||
if e == XMLElement::NumberingProperty {
|
if e == XMLElement::NumberingProperty {
|
||||||
if level.is_none() {
|
if level.is_none() {
|
||||||
return Ok(NumberingProperty::new()
|
if let Some(id) = id {
|
||||||
.id(NumberingId::new(id.expect("should id exists"))));
|
return Ok(NumberingProperty::new().id(NumberingId::new(id)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if let Some(id) = id {
|
if let Some(id) = id {
|
||||||
let np = NumberingProperty::new()
|
let np = NumberingProperty::new()
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -136,6 +136,12 @@ describe("reader", () => {
|
||||||
const json = w.readDocx(buffer);
|
const json = w.readDocx(buffer);
|
||||||
expect(json).toMatchSnapshot();
|
expect(json).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("should read without num id", () => {
|
||||||
|
const buffer = readFileSync("../fixtures/without_numid/without_numid.docx");
|
||||||
|
const json = w.readDocx(buffer);
|
||||||
|
expect(json).toMatchSnapshot();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("writer", () => {
|
describe("writer", () => {
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue