3 releases

0.1.2 Jun 4, 2020
0.1.1 May 19, 2019
0.1.0 Mar 16, 2019

#13 in #virtual-dom

Download history 51/week @ 2024-07-21 118/week @ 2024-07-28 47/week @ 2024-08-04 57/week @ 2024-08-11 41/week @ 2024-08-18 76/week @ 2024-08-25 52/week @ 2024-09-01 47/week @ 2024-09-08 37/week @ 2024-09-15 59/week @ 2024-09-22 102/week @ 2024-09-29 14/week @ 2024-10-06 26/week @ 2024-10-13 29/week @ 2024-10-20 31/week @ 2024-10-27 47/week @ 2024-11-03

134 downloads per month
Used in 10 crates (2 directly)

MIT/Apache

10KB
123 lines

The html-validation crate provides method that can be used when validating html elements and attributes.

The original goal of this crate was to be used as a dependency in procedural macros that validate html at compile time, but it is general purpose and can be used in other problem spaces.

Potential Strategy - Pessimistic Validation

We might make the html-validation crate is pessimistic by nature.

This means that as we develop the create we'll blacklist more and more things - but in general we default to not saying that something is invalid until we've specifically encoded that it is not allowed.

This means that you'll see methods with names like is_definitely_invalid_child - hinting that we're telling you that we're certain that the relationship is not allowed.

Over time we'll cover more and more cases and this should become a non issue, but at the beginning it will mean that our validation is less strict than it should really be.

The reason behind this strategy is that it lets people get up and running from day one without needing to wait until our validation is perfect. A downside is that as we become more and more strict there might be situations where you have to go back and tweak your html if you had something that we are now calling invalid.

Potential Strategy - Optimistic Validation

In this case we'd make html! generate a compile time error for anything that isn't certainly valid. Then there would be a second macro such as html_unstrict! that would be a bit more permissive.

Over time as our validation permitted more cases people could use html! more and more instead of html_loose!

Dependencies

~10KB