#include "testlib.h" RENDER(Request& context) { u64 passed = 0; u64 failed = 0; u64 skipped = 0; auto check = [&](String name, bool ok, String detail) { site_tests_case(name, ok ? "pass" : "fail", detail); if(ok) passed++; else failed++; }; String markdown_src = "# Site Test Heading\n\nParagraph with **bold** content.\n\n:::warning\nWatch the component hook\n:::\n\n```txt\ncode block\n```\n"; DTree options; options["components"][":::warning"] = "components/markdown/warning"; options["components"]["node.code_block"] = "components/markdown/code_block"; DTree ast = markdown_to_ast(markdown_src, options); String ast_json = json_encode(ast); String html = markdown_to_html(markdown_src, options); String ast_excerpt = ast_json.substr(0, ast_json.length() > 220 ? 220 : ast_json.length()); site_tests_page_start("Markdown", "Markdown parser coverage with component-backed directive and node hooks."); check("markdown_to_ast()", ast_json.find("heading") != String::npos || ast_json.find("code_block") != String::npos, ast_excerpt); check("markdown_to_html()", html.find("

Rendered HTML