[go: up one dir, main page]

svgparser 0.4.3

Simple, streaming, zero-allocation SVG parser.
Documentation
diff --git a/src/stream.rs b/src/stream.rs
index b708e9a..949dcce 100644
--- a/src/stream.rs
+++ b/src/stream.rs
@@ -911,7 +911,7 @@ impl<'a> Stream<'a> {
                 if n.is_finite() {
                     Ok(n)
                 } else {
-                    // inf, nan, etc. are an error
+                    // inf, nan, etc. is error
                     gen_err!()
                 }
             }
diff --git a/src/style.rs b/src/style.rs
index 83ef948..e1231a2 100644
--- a/src/style.rs
+++ b/src/style.rs
@@ -209,13 +209,12 @@ fn parse_entity_ref<'a>(stream: &mut Stream<'a>) -> Result<Token<'a>, Error> {
 
 fn parse_prefix<'a>(stream: &mut Stream<'a>) -> Result<(), Error> {
     // prefixed attributes are not supported, aka '-webkit-*'
-    let l = stream.len_to_or_end(b';');
-    warnln!("Style attribute '{}' is skipped.",
-             stream.slice_next_raw(l));
 
-    stream.advance_raw(l);
-    if !stream.at_end() {
-        stream.advance_raw(1);
+    stream.advance_raw(1); // -
+    let t = parse_attribute(stream)?;
+
+    if let Token::XmlAttribute(name, _) = t {
+        warnln!("Style attribute '-{}' is skipped.", name);
     }
 
     Ok(())
diff --git a/tests/style.rs b/tests/style.rs
index 839577b..abf123e 100644
--- a/tests/style.rs
+++ b/tests/style.rs
@@ -78,7 +78,10 @@ fn parse_style_9() {
     assert_eq!(s.parse_next().unwrap(), style::Token::EndOfStream);
 }
 
-test_attr!(parse_style_10, "/**/",
+test_attr!(parse_style_10, "/**/", );
+
+test_attr!(parse_style_11, "font-family:Cantarell;-inkscape-font-specification:&apos;Cantarell Bold&apos;",
+    (AId::FontFamily, "Cantarell")
 );
 
 #[test]