@burdenoff/website-sdk 2026.517.4 → 2026.517.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2870,12 +2870,59 @@ function useContentPages(options) {
2870
2870
  }, [fetchPages]);
2871
2871
  return { data, loading, error, refetch: fetchPages };
2872
2872
  }
2873
+ function renderMarkdown(md) {
2874
+ let html = md;
2875
+ html = html.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2876
+ html = html.replace(/```(\w*)\n([\s\S]*?)```/g, (_m, _lang, code) => {
2877
+ return `<pre><code>${code.trim()}</code></pre>`;
2878
+ });
2879
+ html = html.replace(/`([^`]+)`/g, "<code>$1</code>");
2880
+ html = html.replace(/^###### (.+)$/gm, "<h6>$1</h6>");
2881
+ html = html.replace(/^##### (.+)$/gm, "<h5>$1</h5>");
2882
+ html = html.replace(/^#### (.+)$/gm, "<h4>$1</h4>");
2883
+ html = html.replace(/^### (.+)$/gm, "<h3>$1</h3>");
2884
+ html = html.replace(/^## (.+)$/gm, "<h2>$1</h2>");
2885
+ html = html.replace(/^# (.+)$/gm, "<h1>$1</h1>");
2886
+ html = html.replace(/\*\*\*(.+?)\*\*\*/g, "<strong><em>$1</em></strong>");
2887
+ html = html.replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>");
2888
+ html = html.replace(/\*(.+?)\*/g, "<em>$1</em>");
2889
+ html = html.replace(
2890
+ /\[([^\]]+)\]\(([^)]+)\)/g,
2891
+ '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'
2892
+ );
2893
+ html = html.replace(/^&gt; (.+)$/gm, "<blockquote>$1</blockquote>");
2894
+ html = html.replace(/(^- .+$(\n^- .+$)*)/gm, (block) => {
2895
+ const items = block.split("\n").map((line) => `<li>${line.replace(/^- /, "")}</li>`).join("");
2896
+ return `<ul>${items}</ul>`;
2897
+ });
2898
+ html = html.replace(/(^\d+\. .+$(\n^\d+\. .+$)*)/gm, (block) => {
2899
+ const items = block.split("\n").map((line) => `<li>${line.replace(/^\d+\. /, "")}</li>`).join("");
2900
+ return `<ol>${items}</ol>`;
2901
+ });
2902
+ html = html.replace(/^---$/gm, "<hr />");
2903
+ html = html.split(/\n\n+/).map((block) => {
2904
+ const trimmed = block.trim();
2905
+ if (!trimmed) return "";
2906
+ if (/^<(h[1-6]|ul|ol|pre|blockquote|hr)/.test(trimmed)) return trimmed;
2907
+ return `<p>${trimmed.replace(/\n/g, "<br />")}</p>`;
2908
+ }).join("\n");
2909
+ return html;
2910
+ }
2873
2911
  function ContentRenderer({
2874
2912
  content,
2875
2913
  format = "markdown",
2876
2914
  className
2877
2915
  }) {
2878
- if (format === "html" || format === "markdown") {
2916
+ if (format === "markdown") {
2917
+ return /* @__PURE__ */ jsx(
2918
+ "div",
2919
+ {
2920
+ className,
2921
+ dangerouslySetInnerHTML: { __html: renderMarkdown(content) }
2922
+ }
2923
+ );
2924
+ }
2925
+ if (format === "html") {
2879
2926
  return /* @__PURE__ */ jsx(
2880
2927
  "div",
2881
2928
  {