NativeElixirPdfUtilities.Validators.HtmlMetadataValidator (native_elixir_pdf_utilities v1.1.0)

View Source

Validates inert HTML microdata syntax and resolves translation metadata.

The pinned HTML Standard's items, names:-the-itemprop-attribute and the-translate-attribute sections define these attributes. Authored values remain unchanged. Microdata identifiers never select assets or PDF links. Vocabulary definitions, property association/crawling and extraction APIs are outside this preservation contract. Unknown vocabularies are opaque; their common-vocabulary and global-identifier rules cannot be inferred from URL prefixes or checked by fetching them.

Summary

Functions

Resolves logical translation and editing inheritance on a composed projection without changing identities or authored attributes.

Selects initially enabled HTML and SVG style blocks in one authored document light tree.

Selects shadow-root style blocks without document stylesheet-set titles or metadata pragmas.

Selects initially enabled HTML style blocks in authored tree order without fetching resources.

Resolves translation mode without changing authored attributes or text.

Returns the first top-level authored document/tree identity, or the unbound legacy scope.

Returns unqualified semantic attributes without changing authored source or selector metadata.

Validates applicable, unnamespaced HTML microdata attribute syntax.

Checks that applicable itemref tokens name elements in the same authored tree.

Functions

prepare_composed_nodes(logical, projection, clones)

@spec prepare_composed_nodes(map(), [map()], map()) :: [map()]

Resolves logical translation and editing inheritance on a composed projection without changing identities or authored attributes.

selected_document_style_nodes(nodes, media_context)

@spec selected_document_style_nodes([map()], map() | nil | :unpositioned) :: [map()]

Selects initially enabled HTML and SVG style blocks in one authored document light tree.

selected_shadow_style_nodes(nodes, media_context)

@spec selected_shadow_style_nodes([map()], map() | nil | :unpositioned) :: [map()]

Selects shadow-root style blocks without document stylesheet-set titles or metadata pragmas.

selected_style_nodes(nodes, media_context)

@spec selected_style_nodes(
  [map()],
  NativeElixirPdfUtilities.Validators.PrintMediaValidator.context()
  | nil
  | :unpositioned
) :: [map()]

Selects initially enabled HTML style blocks in authored tree order without fetching resources.

translation_mode(node, inherited?)

@spec translation_mode(map(), boolean()) :: boolean()

Resolves translation mode without changing authored attributes or text.

tree_scope(nodes)

@spec tree_scope([map()]) :: {term(), term()}

Returns the first top-level authored document/tree identity, or the unbound legacy scope.

unqualified_attributes(node)

@spec unqualified_attributes(map()) :: map()

Returns unqualified semantic attributes without changing authored source or selector metadata.

validate_attributes(node, source \\ nil)

@spec validate_attributes(map(), String.t() | nil) ::
  :ok | {:error, {atom(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}

Validates applicable, unnamespaced HTML microdata attribute syntax.

validate_item_references(node, tree)

@spec validate_item_references(map(), [map()]) ::
  :ok | {:error, {atom(), NativeElixirPdfUtilities.Diagnostics.diagnostic()}}

Checks that applicable itemref tokens name elements in the same authored tree.