package tyxml

  1. Overview
  2. Docs
A library for building correct HTML and SVG documents

Install

dune-project
 Dependency

Authors

Maintainers

Sources

tyxml-5.0.0.tbz
sha256=c725bb8918ff1b601e7926b7b6b4799f8f4ab70f5fba9f0970da657cb82c07f2
sha512=61881aa7101b5072b887802e78897920516c9c2b484d51ac281509e83c79969c7654caa31b125ad843b45740dfe143ed5218fd7e4d98dfba8e0b24b272308ed6

doc/tyxml.functor/Xml_print/Utf8/index.html

Module Xml_print.Utf8Source

Utf8 normalizer and encoder for HTML.

Given a pp function produced by one of the functors in Xml_print, this modules is used as following:

  let encode x = fst (Xml_print.Utf8.normalize_html x) in
  Format.printf "%a" (Html.pp ~encode ()) document
Sourcetype utf8 = string
Sourceval normalize : string -> utf8 * bool

normalize str take a possibly invalid utf-8 string and return a valid utf-8 string where invalid bytes have been replaced by the replacement character U+FFFD. The returned boolean is true if invalid bytes were found

Sourceval normalize_html : string -> utf8 * bool

Same as normalize plus some extra work : It encode '<' , '>' , '"' , '&' characters with corresponding entities and replaced invalid html character by U+FFFD