HTML
Last modified by Clément Eraud on 2025/11/18 17:19
Macros can be rendered directly to HTML any service implementing the MacrosAstToHtmlConverter interface (such as DefaultMacrosAstToHtmlConverter):
/**
* Convert macros' AST to HTML.
*
* @since 0.24-rc-1
* @beta
*/
export interface MacrosAstToHtmlConverter {
/**
* Render a macro's AST blocks to an HTML string.
* Note that the HTML body it **NOT** sanitized.
*
* @param blocks - The blocks to render
* @param htmlBody - HTML-converted body of macros with `bodyType` set to `wysiwyg`
*
* @returns The HTML render
*/
blocksToHTML(blocks: MacroBlock[], htmlBody: string | null): string | Error;
/**
* Render a macro's AST inline contents to an HTML string.
* Note that the HTML body it **NOT** sanitized.
*
* @param inlineContents - The inline contents to render
* @param htmlBody - HTML-converted body of macros with `bodyType` set to `wysiwyg`
*
* @returns The HTML render
*/
inlineContentsToHTML(
inlineContents: MacroInlineContent[],
htmlBody: string | null,
): string | Error;
}

This project is being financed by the French State as part of the France 2030 program
Ce projet est financé par l’État Français dans le cadre de France 2030