-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(rule): add html lang validation
- Loading branch information
Showing
8 changed files
with
79 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "accessibility-rs" | ||
version = "0.0.5" | ||
version = "0.0.6" | ||
authors = ["The A11yWatch Project Developers", "Jeff Mendez <[email protected]>"] | ||
edition = "2021" | ||
license = "MIT OR Apache-2.0" | ||
|
@@ -26,6 +26,8 @@ accessibility-tree = { version = "0.0.1", path = "../accessibility-tree/victor" | |
markup5ever = "0.11.0" | ||
cssparser = { workspace = true } | ||
slotmap = "1.0.6" | ||
strum = "0.25" | ||
strum_macros = "0.25" | ||
|
||
[dev-dependencies] | ||
wasm-bindgen-test = "0.3.37" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
use std::vec; | ||
use strum_macros::IntoStaticStr; | ||
|
||
#[derive(PartialOrd, Ord, std::cmp::Eq, PartialEq, Hash, Debug)] | ||
#[derive(PartialOrd, Ord, std::cmp::Eq, PartialEq, Hash, Debug, IntoStaticStr)] | ||
/// techniques for WCAG <https://www.w3.org/TR/WCAG20-TECHS/> | ||
pub enum Techniques { | ||
/// <https://www.w3.org/TR/WCAG20-TECHS/H25.html> | ||
H25, | ||
/// <https://www.w3.org/TR/WCAG20-TECHS/H32.html> | ||
H32, | ||
/// <https://www.w3.org/TR/WCAG20-TECHS/H57> | ||
H57 | ||
} | ||
|
||
impl Techniques { | ||
/// get rule id to string | ||
pub fn as_str(&self) -> &'static str { | ||
match self { | ||
Techniques::H25 => "H25", | ||
Techniques::H32 => "H32", | ||
} | ||
// todo: make macro | ||
self.into() | ||
} | ||
/// get pairs for a rule | ||
pub fn pairs(&self) -> Vec<&'static str> { | ||
match self { | ||
Techniques::H25 => vec!["H25.1.NoTitleEl", "H25.1.EmptyTitle"], | ||
Techniques::H32 => vec!["H32.2"], | ||
Techniques::H57 => vec!["H57.2", "H57.3.Lang", "H57.3.XmlLang"], | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters