chore: Fix several style lints (#17488)

It's not comprehensive enough to start linting on `style` group, but
hey, it's a start.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-09-06 11:58:39 +02:00 committed by GitHub
parent 93249fc82b
commit e6c1c51b37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
361 changed files with 3530 additions and 3587 deletions

View file

@ -54,13 +54,8 @@ impl HandleTag for WikipediaInfoboxHandler {
tag: &HtmlElement,
_writer: &mut MarkdownWriter,
) -> StartTagOutcome {
match tag.tag() {
"table" => {
if tag.has_class("infobox") {
return StartTagOutcome::Skip;
}
}
_ => {}
if tag.tag() == "table" && tag.has_class("infobox") {
return StartTagOutcome::Skip;
}
StartTagOutcome::Continue
@ -77,12 +72,15 @@ impl WikipediaCodeHandler {
}
}
impl Default for WikipediaCodeHandler {
fn default() -> Self {
Self::new()
}
}
impl HandleTag for WikipediaCodeHandler {
fn should_handle(&self, tag: &str) -> bool {
match tag {
"div" | "pre" | "code" => true,
_ => false,
}
matches!(tag, "div" | "pre" | "code")
}
fn handle_tag_start(
@ -134,7 +132,7 @@ impl HandleTag for WikipediaCodeHandler {
fn handle_text(&mut self, text: &str, writer: &mut MarkdownWriter) -> HandlerOutcome {
if writer.is_inside("pre") {
writer.push_str(&text);
writer.push_str(text);
return HandlerOutcome::Handled;
}