/** * @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: * //This is bold and italic text.
* //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