Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface HtmlTokenizerOptions

HTML Tokenization options.

Hierarchy

  • HtmlTokenizerOptions

Index

Properties

attributeToStyleMap

attributeToStyleMap: Record<string, keyof StyleOptions>

A mapping between an attribute name (lowercase) and a style it sets. By default these attributes are supported: fontsize, size, fontstyle, style, fontweight, weight, fontvariant, variant, fontfamily, family, fontstretch, stretch, color

blockTags

blockTags: string[]

An array of HTML tag names (must be lowercase) that will have an end line inserted when they are closed. Defaults to: p, div and br.

remarks

<br/> tag must always be closed.

defaultStyles

defaultStyles: StyleOptions

Default style options to use for text with no custom styling.

Optional newlineBehavior

newlineBehavior: "space" | "br"

How newline characters should be treated:

  • space will replace them with a space
  • br will replace them with a <br/> tag
remark

Windows-style newlines (\r\n) are always replaced with a single \n tag.

tagDefaultStyles

tagDefaultStyles: Record<string, Partial<StyleOptions>>

A maping between a tag name (lowercase) and its default styles. By default these tags have styles: b, strong, i and em.

Generated using TypeDoc