Function processHTML

  • Processes the given HTML by creating by running a CSS selector query with all matched elements being passed through the provided process function.

    Parameters

    • opts: {
          containerElement?: string;
          firstMatchOnly?: boolean;
          html: string;
          namespaceURI?: string;
          process: ((HTMLElement: any) => void);
          selector: string;
      }

      Options

      • OptionalcontainerElement?: string

        Use a specific container element.

      • OptionalfirstMatchOnly?: boolean

        When true querySelector is invoked to process the first matching element only.

      • html: string

        The HTML to process.

      • OptionalnamespaceURI?: string

        The namespace URI of the elements to select.

      • process: ((HTMLElement: any) => void)

        The selected element processing function.

          • (HTMLElement): void
          • Parameters

            • HTMLElement: any

            Returns void

      • selector: string

        The CSS selector query.

    Returns string

    The processed HTML.