@@ -1,11 +0,0 @@
|
||||
import React from "react";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
|
||||
// Same renderer used for the live Preview tab (via <ReactMarkdown>), so the
|
||||
// stored html_body always matches what the admin saw in preview.
|
||||
export function markdownToHtml(markdown) {
|
||||
const trimmed = (markdown ?? "").trim();
|
||||
if (!trimmed) return "";
|
||||
return renderToStaticMarkup(React.createElement(ReactMarkdown, null, trimmed));
|
||||
}
|
||||
Reference in New Issue
Block a user