Chore: merge validation into macr

This commit is contained in:
Jonathan Kelley 2021-01-19 09:08:41 -05:00
parent 33a805da40
commit 6c1205e91b
9 changed files with 12 additions and 27 deletions

View file

@ -5,15 +5,16 @@ members = [
"packages/hooks", "packages/hooks",
"packages/recoil", "packages/recoil",
"packages/redux", "packages/redux",
"packages/web", # TODO @Jon, share the validation code
# "packages/web",
"packages/cli", "packages/cli",
"examples",
"packages/html-macro",
# #
# #
# #
# Pulled from percy # Pulled from percy
"packages/html-macro",
# "packages/html-macro-test", # "packages/html-macro-test",
# "packages/virtual-dom-rs", # "packages/virtual-dom-rs",
# "packages/virtual-node", # "packages/virtual-node",
"examples",
] ]

View file

@ -18,4 +18,5 @@ proc-macro = true
proc-macro2 = { version = "0.4", features = ["span-locations"] } proc-macro2 = { version = "0.4", features = ["span-locations"] }
quote = "0.6.11" quote = "0.6.11"
syn = { version = "0.15", features = ["full", "extra-traits"] } syn = { version = "0.15", features = ["full", "extra-traits"] }
html-validation = { path = "../html-validation", version = "0.1.2" } lazy_static = "1.4.0"
# html-validation = { path = "../html-validation", version = "0.1.2" }

View file

@ -7,6 +7,7 @@ use syn::parse_macro_input;
mod parser; mod parser;
mod tag; mod tag;
pub(crate) mod validation;
/// Used to generate VirtualNode's from a TokenStream. /// Used to generate VirtualNode's from a TokenStream.
/// ///

View file

@ -262,9 +262,9 @@ struct RecentSpanLocations {
} }
fn is_self_closing(tag: &str) -> bool { fn is_self_closing(tag: &str) -> bool {
html_validation::is_self_closing(tag) crate::validation::self_closing::is_self_closing(tag)
} }
fn is_valid_tag(tag: &str) -> bool { fn is_valid_tag(tag: &str) -> bool {
html_validation::is_valid_tag(tag) crate::validation::valid_tags::is_valid_tag(tag)
} }

View file

@ -31,12 +31,6 @@
//! //!
//! Over time as our validation permitted more cases people could use html! more and more instead of html_loose! //! Over time as our validation permitted more cases people could use html! more and more instead of html_loose!
#![deny(missing_docs)] pub mod self_closing;
pub mod svg_namespace;
pub use self_closing::is_self_closing; pub mod valid_tags;
pub use svg_namespace::is_svg_namespace;
pub use valid_tags::is_valid_tag;
mod self_closing;
mod svg_namespace;
mod valid_tags;

View file

@ -1,12 +0,0 @@
[package]
name = "html-validation"
version = "0.1.2"
authors = ["Chinedu Francis Nwafili <frankie.nwafili@gmail.com>"]
description = "Validation for HTML elements and attributes"
keywords = ["html", "validation", "valid", "dom", "virtual"]
license = "MIT/Apache-2.0"
repository = "https://github.com/chinedufn/percy"
edition = "2018"
[dependencies]
lazy_static = "1.4.0"