Skip to content

Commit

Permalink
Take the content in TextPath::new
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanUkhov committed Apr 18, 2024
1 parent 626016a commit 3f6b2f3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "svg"
version = "0.16.0"
version = "0.17.0"
edition = "2021"
license = "Apache-2.0 OR MIT"
authors = [
Expand Down
34 changes: 18 additions & 16 deletions src/node/element/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,6 @@ implement! {
#[doc = "A [`symbol`](https://www.w3.org/TR/SVG/struct.html#SymbolElement) element."]
struct Symbol

#[doc = "A [`textPath`](https://www.w3.org/TR/SVG/text.html#TextPathElement) element."]
struct TextPath

#[doc = "A [`use`](https://www.w3.org/TR/SVG/struct.html#UseElement) element."]
struct Use
}
Expand Down Expand Up @@ -369,33 +366,38 @@ macro_rules! implement {
}

implement! {
#[doc = "A [`text`](https://www.w3.org/TR/SVG/text.html#TextElement) element."]
struct Text [is_bareable] [T: Into<String>] [inner, content: T] {
#[doc = "An [`svg`](https://www.w3.org/TR/SVG/struct.html#SVGElement) element."]
struct SVG [is_bareable] [] [inner] {
inner.assign("xmlns", "http://www.w3.org/2000/svg");
}

#[doc = "A [`script`](https://www.w3.org/TR/SVG/script.html#ScriptElement) element."]
struct Script [is_bareable] [T: Into<String>] [inner, content: T] {
inner.append(crate::node::Text::new(content));
}

#[doc = "A [`title`](https://www.w3.org/TR/SVG/struct.html#TitleElement) element."]
struct Title [] [T: Into<String>] [inner, content: T] {
#[doc = "A [`style`](https://www.w3.org/TR/SVG/styling.html#StyleElement) element."]
struct Style [is_bareable] [T: Into<String>] [inner, content: T] {
inner.append(crate::node::Text::new(content));
}

#[doc = "A [`tspan`](https://www.w3.org/TR/SVG/text.html#TextElement) element."]
struct TSpan [] [T: Into<String>] [inner, content: T] {
#[doc = "A [`text`](https://www.w3.org/TR/SVG/text.html#TextElement) element."]
struct Text [is_bareable] [T: Into<String>] [inner, content: T] {
inner.append(crate::node::Text::new(content));
}

#[doc = "An [`svg`](https://www.w3.org/TR/SVG/struct.html#SVGElement) element."]
struct SVG [is_bareable] [] [inner] {
inner.assign("xmlns", "http://www.w3.org/2000/svg");
#[doc = "A [`textPath`](https://www.w3.org/TR/SVG/text.html#TextPathElement) element."]
struct TextPath [] [T: Into<String>] [inner, content: T] {
inner.append(crate::node::Text::new(content));
}

#[doc = "A [`script`](https://www.w3.org/TR/SVG/script.html#ScriptElement) element."]
struct Script [is_bareable] [T: Into<String>] [inner, content: T] {
#[doc = "A [`title`](https://www.w3.org/TR/SVG/struct.html#TitleElement) element."]
struct Title [] [T: Into<String>] [inner, content: T] {
inner.append(crate::node::Text::new(content));
}

#[doc = "A [`style`](https://www.w3.org/TR/SVG/styling.html#StyleElement) element."]
struct Style [is_bareable] [T: Into<String>] [inner, content: T] {
#[doc = "A [`tspan`](https://www.w3.org/TR/SVG/text.html#TextElement) element."]
struct TSpan [] [T: Into<String>] [inner, content: T] {
inner.append(crate::node::Text::new(content));
}
}
Expand Down

0 comments on commit 3f6b2f3

Please sign in to comment.