@mitre/nuxt-smartscript
Version:
Smart typography transformations for Nuxt - automatic superscript, subscript, and symbol formatting
25 lines (24 loc) • 961 B
TypeScript
/**
* Shared transformation logic for both client and server
* Converts text to HTML strings using our existing processor logic
*/
import type { TextPart } from './types.js';
/**
* Convert TextPart array to HTML string
*/
export declare function partsToHTML(parts: TextPart[]): string;
/**
* Transform text content to HTML string using our existing processor
* This is the main function for SSR/SSG
*/
export declare function transformTextToHTML(text: string, pattern: RegExp): string;
/**
* Transform HTML content by finding and processing text nodes
* This processes an entire HTML string for SSR/SSG
*/
export declare function transformHTMLContent(html: string, pattern: RegExp, _excludeSelectors?: string[]): string;
/**
* Simple HTML parser for better accuracy (optional enhancement)
* This is a more robust approach if the regex method has issues
*/
export declare function transformHTMLContentRobust(html: string, pattern: RegExp): string;