/** * @module research/extractor/html-to-content/html-utils * @description Research library module. */ /** * Converts URL-safe escaped HTML codes like &"'`’ & to standard HTML or in reverse. * @param {string} str - The string to process. * @param {boolean} toStandardHTML default=true - If true, converts url-safe codes * to standard HTML. If false, converts standard HTML to url-safe codes. * @return {string} The processed string. * @category HTML Utilities * @example * var normalHTML = convertURLSafeHTMLToHTML('<p>This & that © 2023 '+ * '"Quotes"'Apostrophes' €100 ☺</p>', true) * console.log(normalHTML) // "

This & that \u00a9 2023 "Quotes" 'Apostrophes' \u20ac100 \u263a

" */ export declare function convertURLSafeHTMLToHTML(str: any, toStandardHTML?: boolean): any; /** * Convert relative URL to absolute URL using base URL. * @param {string} base base url of the domain * @param {string} relative partial urls like ../images/image.jpg #hash * @returns {string} absolute URL * @example * var absoluteURL = convertURLToAbsoluteURL('https://example.com', 'images/image.jpg') * console.log(absoluteURL) // Returns: "https://example.com/images/image.jpg" * var absoluteURL = convertURLToAbsoluteURL('https://example.com', '//images/image.jpg') * console.log(absoluteURL) // Returns: "https:images/image.jpg" * @category HTML Utilities * @author [vtempest (2025)](https://github.com/vtempest) */ export declare function convertURLToAbsoluteURL(base: any, relative: any): any; /** * Converts Markdown text to HTML. It handles the following Markdown elements: * - Headers (h1 to h6) * - Bold text * - Italic text * - Unordered lists * - Ordered lists * - Paragraphs * - Images * - Links * - Code blocks * @param {string} content - The Markdown or HTML content to be converted. * @param {boolean} toHtml - default=true - If true, converts Markdown to HTML. * If false, converts HTML to Markdown. * @returns {string} The resulting HTML string. * @category HTML Utilities * @example * const markdown = "# Header\n\nThis is **bold** and *italic* text.\n\n* List item 1\n* List item 2"; * const html = convertMarkdownToHTML(markdown); * console.log(html); * // Output: * //

Header

* //

This is bold and italic text.

* // */ export declare function convertMarkdownToHTML(content: any, toHtml?: boolean): any; /** * Convert a Markdown document to formatted HTML using regular expressions to * detect Markdown syntax. Unlike {@link convertMarkdownToHTML} (which relies on * the `marked` library), this is a dependency-free, self-contained converter * intended for post-processing content returned as Markdown (e.g. from the * JINA reader fallback in the scraper). * * Supported block elements: ATX headers (`#`..`######`), fenced code blocks * (```lang), blockquotes (`>`), unordered lists (`-`, `*`, `+`), ordered lists * (`1.`, `1)`), horizontal rules (`---`, `***`, `___`) and paragraphs. * Supported inline elements: bold, italic, strikethrough, inline code, images * and links. * * @param {string} markdown - The Markdown content to convert. * @returns {string} The resulting formatted HTML string. * @category HTML Utilities * @example * convertMarkdownToFormattedHTML("# Title\n\nSome **bold** text."); * // => "

Title

\n

Some bold text.

" */ export declare function convertMarkdownToFormattedHTML(markdown: any): string; export declare function convertHTMLToMarkdown(html: any): any; /** * Copy HTML to clipboard. When pasting into rich text field, * pastes rich text. When pasting into plain text field, pastes: * plain text, html, or markdown. * * @param {string} html - The HTML content to be copied. * @param {object} options - The options object. * @param {number} options.pastePlainFormat - * default=0 * 0 - plain text * 1 - markdown * 2 - html * @returns {Promise} - A promise that resolves when * the HTML is copied to the clipboard. * @category HTML Utilities * @author [vtempest (2025)](https://github.com/vtempest) */ export declare function copyHTMLToClipboard(html: any, options?: {}): Promise;