* fix: fallback ignore

* update

* fix: spec
main
bokuweb 2020-04-07 10:55:44 +09:00 committed by GitHub
parent a98ea28679
commit 83d7dc2b01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 11 deletions

View File

@ -3,7 +3,7 @@ use std::fs::*;
use std::io::Read;
pub fn main() {
let mut file = File::open("./fixtures/image_node_docx/image.docx").unwrap();
let mut file = File::open("./textbox.docx").unwrap();
let mut buf = vec![];
file.read_to_end(&mut buf).unwrap();
dbg!(read_docx(&buf).unwrap().json());

View File

@ -21,7 +21,6 @@ impl ElementReader for AGraphic {
let e = AXMLElement::from_str(&name.local_name)
.expect("should convert to XMLElement");
if let AXMLElement::GraphicData = e {
dbg!("graphicData1");
let data = AGraphicData::read(r, &attributes)?;
graphic = graphic.add_graphic_data(data);
}

View File

@ -19,11 +19,9 @@ impl ElementReader for AGraphicData {
t = GraphicDataType::from_str(&a.value).unwrap();
}
}
dbg!(&t);
let mut graphic_data = AGraphicData::new(t);
loop {
let e = r.next();
dbg!(&graphic_data, &e);
match e {
Ok(XmlEvent::StartElement {
name, attributes, ..
@ -32,7 +30,6 @@ impl ElementReader for AGraphicData {
.expect("should convert to XMLElement");
match e {
WpsXMLElement::Wsp => {
dbg!("asdad");
let shape = WpsShape::read(r, &attributes)?;
graphic_data = graphic_data.add_shape(shape);
}

View File

@ -226,9 +226,9 @@ impl FromStr for McXMLElement {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"alternateContent" => Ok(McXMLElement::AlternateContent),
"choice" => Ok(McXMLElement::Choice),
"fallback" => Ok(McXMLElement::Fallback),
"AlternateContent" => Ok(McXMLElement::AlternateContent),
"Choice" => Ok(McXMLElement::Choice),
"Fallback" => Ok(McXMLElement::Fallback),
_ => Ok(McXMLElement::Unsupported),
}
}

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,6 +1,6 @@
{
"name": "docx-wasm",
"version": "0.0.59",
"version": "0.0.60",
"main": "dist/node/index.js",
"browser": "dist/web/index.js",
"author": "bokuweb <bokuweb12@gmail.com>",