Parsing HTML

HTMLBuilder.jl also lets you parse HTML. After loading the package with

julia> using HTMLBuilder

and loading the raw HTML code into a string,

julia> raw_HTML = raw"<div><h1>A title</h1><p>Some text.</p></div>""<div><h1>A title</h1><p>Some text.</p></div>"

you can parse it by running

julia> parsed = parse_HTML(raw_HTML)<div>
  <h1>A title</h1>
  <p>Some text.</p>
</div>

The parsed HTML is fully compatible with the rest of the features HTMLBuilder.jl. For instance, you can run

julia> dv(h1("A title"), parse_HTML(raw"<p>A paragraph to be parsed.</p>"))<div>
  <h1>A title</h1>
  <p>A paragraph to be parsed.</p>
</div>