Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/anstyle-svg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,10 @@ fn write_fg_span(buffer: &mut String, span: SpanKind, element: &adapter::Element
classes.push("hidden");
}

if span != SpanKind::Tspan && classes.is_empty() && element.url.is_none() {
// No need to create an element if there is no class or href.
write!(buffer, "{fragment}").unwrap();
}
let mut need_closing_a = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If already splitting everything, why not have this in the match?


write!(buffer, r#"<{span}"#).unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are writing out the fragment with and without a span in this commit

Expand Down
Loading