package tyxml

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

Install

Dune Dependency

Authors

Maintainers

Sources

tyxml-4.6.0.tbz
sha256=bfeb673c6b4e120a4eca4c48448add47dc3f8d02c2b40f63ffdccc4e91c902dd
sha512=69750eeaf467014282087bf9628f3278f3e5f00f4c7400358750d208664cfc3f79a5cba16767d2935e53477d1a6862fe08c5b801b69052ec12e09d1a93a5e9b4

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

OCaml

Innovation. Community. Security.