parent
cd214fdaf5
commit
79841fca0c
|
@ -36,8 +36,9 @@ impl ElementReader for NumberingProperty {
|
|||
let e = XMLElement::from_str(&name.local_name).unwrap();
|
||||
if e == XMLElement::NumberingProperty {
|
||||
if level.is_none() {
|
||||
return Ok(NumberingProperty::new()
|
||||
.id(NumberingId::new(id.expect("should id exists"))));
|
||||
if let Some(id) = id {
|
||||
return Ok(NumberingProperty::new().id(NumberingId::new(id)));
|
||||
}
|
||||
}
|
||||
if let Some(id) = id {
|
||||
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);
|
||||
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", () => {
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue