Skip to main content

DocumentMetadata

export
interface DocumentMetadata {
  baseTarget: "_blank"
    | "_self"
    | "_parent"
    | "_top";
  baseUrl: string;
  dir: "ltr" | "rtl";
  lang: string;
  links: Array<Record<string, string>>;
  meta: Array<{
    name: string;
    value: string;
  }>;
  title: string;
}

An object containing meta-data extracted from resource URL and HTML <head> element.

Fields#

baseTarget#

required
baseTarget: "_blank"
  | "_self"
  | "_parent"
  | "_top";

How anchors should be actioned on press?

Remarks

By default, renderersProps.a.onPress will always open the system browser, equivalent to _blank target. However, you can customize the behavior by providing your own implementation.

baseUrl#

required
baseUrl: string;

The base URL of this resource. It will influence how relative URLs are resolved such as href and src element properties. By order of precedence:

  1. baseUrl from <base/> html element;
  2. baseUrl from source.baseUrl prop;
  3. baseUrl as origin of source.uri prop.

dir#

required
dir: "ltr" | "rtl";

The writing direction of this document, extracted from the dir attribute of <html/> element.

lang#

required
lang: string;

The language of this document, extracted from the lang attribute of the <html/> element;

links#

required
links: Array<Record<string, string>>;

A data array comprised of attributes from <link> elements.

meta#

required
meta: Array<{
  name: string;
  value: string;
}>;

A data array comprised of attributes from <meta> elements.

title#

required
title: string;

The content of the <title> element.