funchaku v0.6.0 Funchaku.Checker
Provides methods to validate HTML on the Nu HTML Checker.
Summary
Functions
Validates the given URL on the Nu HTML Checker
Validates the given text on the Nu HTML Checker
Functions
Validates the given URL on the Nu HTML Checker.
Options:
- Will use by default the validator at http://validator.w3.org/nu/, this can
and should be customized to use your own validator, with the
checker_urloption.
Examples
iex> { :ok, results } = Funchaku.check("http://validationhell.com")
iex> length(results[:messages])
21
iex> length(results[:errors])
19
iex> length(results[:warnings])
2
iex> List.first(results[:errors])["message"]
"Obsolete doctype. Expected “<!DOCTYPE html>”."
Validates the given text on the Nu HTML Checker.
Options:
- Will use by default the validator at http://validator.w3.org/nu/, this can
and should be customized to use your own validator, with the
checker_urloption.
Examples
iex> { :ok, results } = Funchaku.check_text "<!DOCTYPE html><html></html>"
iex> length(results[:messages])
2
iex> length(results[:non_document_errors])
0
iex> length(results[:errors])
1
iex> length(results[:warnings])
1
iex> List.first(results[:errors])["message"]
"Element “head” is missing a required instance of child element “title”."