import gleam/string import gleam/string_builder.{StringBuilder} import gleam/int import gleam/list import glentities/internal/string_utils pub type EncodeMode { /// Encode all characters that have a specified named entity using that name, except tab and newline. Named /// Encode all characters using hex entities, except a-z, A-Z, 0-9, newline, tab, carriage return, and space. Hex /// Encode only the necessary characters when the output target is HTML element or attribute content. /// /// This means `&`, `<`, `>`, `'`, and `"`. /// /// Note! Not suitable for outputting inside `