std/html/error

std/html/src/error.trb

HtmlParseError: a recoverable error of the HTML standard, as the tokenizer reports it beside the tokens.

type HtmlParseError

type HtmlParseError with Show, Equals, Hash

A parse error of the HTML standard. Reading HTML never fails: every error has a defined recovery, and the tokenizer goes on exactly as the standard says. The errors are a list beside the tokens, for a tool that checks a document.

Examples

use HtmlTokenizer from "std/html"

var tokenizer = HtmlTokenizer.of "<p a=1 a=2>"
tokenizer.tokens()
for problem in tokenizer.errors {
  print problem
}

field code

code: String

The code name of the error in the standard, such as duplicate-attribute or eof-in-tag.

field line

line: Int

The line of the character the tokenizer was at, counted from 1.

field column

column: Int

The column of that character in its line, counted from 1 in characters.

fn show

fn show(): String

line 1, column 8: duplicate-attribute.