Floki v0.25.0 Floki.HTMLParser behaviour View Source

A entrypoint to dynamic dispatch functions to the configured HTML parser.

The configuration can be done with the "html_parser" option for the "floki" application:

use Mix.Config
config :floki, :html_parser, Floki.HTMLParser.Mochiweb

The default parser is Mochiweb, which comes with Floki. You can also choose between Html5ever or FastHtml.

This module is also a behaviour that those parsers must implement.

Link to this section Summary

Link to this section Functions

Link to this section Callbacks

Link to this callback

parse_document(binary)

View Source
parse_document(binary()) :: {:ok, Floki.html_tree()} | {:error, String.t()}
Link to this callback

parse_fragment(binary)

View Source
parse_fragment(binary()) :: {:ok, Floki.html_tree()} | {:error, String.t()}