Skip to content

Commit c1dfa57

Browse files
author
Jay Jackson
committed
allow actually using the feature
1 parent 6909392 commit c1dfa57

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/events/mod.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,22 @@ impl<'a> BytesStart<'a> {
242242
Attributes::wrap(&self.buf, self.name_len, &[], false)
243243
}
244244

245+
/// Returns an iterator over the attributes of this tag, with custom quotes.
246+
pub fn attributes_with_custom_quotes(&self, custom_quotes: &'a [(u8, u8)]) -> Attributes {
247+
Attributes::wrap(&self.buf, self.name_len, custom_quotes, false)
248+
}
249+
245250
/// Returns an iterator over the HTML-like attributes of this tag (no mandatory quotes or `=`).
246251
pub fn html_attributes(&self) -> Attributes {
247252
Attributes::wrap(&self.buf, self.name_len, &[], true)
248253
}
249254

255+
/// Returns an iterator over the HTML-like attributes of this tag (no mandatory quotes or `=`),
256+
/// with custom quotes.
257+
pub fn html_attributes_with_custom_quotes(&self, custom_quotes: &'a [(u8, u8)]) -> Attributes {
258+
Attributes::wrap(&self.buf, self.name_len, custom_quotes, true)
259+
}
260+
250261
/// Gets the undecoded raw string with the attributes of this tag as a `&[u8]`,
251262
/// including the whitespace after the tag name if there is any.
252263
#[inline]
@@ -409,7 +420,7 @@ impl<'a> BytesDecl<'a> {
409420
Some(Ok(a)) => {
410421
let found = from_utf8(a.key.as_ref())?.to_string();
411422
Err(Error::XmlDeclWithoutVersion(Some(found)))
412-
},
423+
}
413424
// error parsing attributes
414425
Some(Err(e)) => Err(e.into()),
415426
// no attributes

0 commit comments

Comments
 (0)