Interface: HtmlOptions

Fine-grained HTML preservation rules passed in GukhanmunOptions.html.

These are additive: a scope is preserved when any rule matches. They correspond to the CLI flags --html-preserve-class and --html-preserve-attr, and to the Rust Builder::html_preserve_when predicate.

Properties

preserveAttributes?

readonly optional preserveAttributes?: readonly (string | { name: string; value?: string; })[]

Attribute matchers; an element is preserved when it carries a matching attribute. Each entry is either:

  • A bare string — preserve any element that has the attribute, regardless of value (e.g. "data-no-translate").
  • An object { name, value? } — preserve elements where the attribute equals value, or has the attribute when value is omitted.

Equivalent to --html-preserve-attr KEY[=VALUE] on the CLI.


preserveClasses?

readonly optional preserveClasses?: readonly string[]

Class names whose containing element (and all descendants) should be treated as a preserved region — the engine skips their text content.

Equivalent to passing --html-preserve-class NAME to the CLI one or more times.