`, so the chat surface supplies the
+ // rules and padding rather than every renderer having to override the cells.
+ "[&_table]:my-4 [&_table]:w-full [&_table]:text-sm [&_table]:border-collapse",
+ "[&_thead_tr]:border-b [&_thead_tr]:border-[var(--edge)]",
+ "[&_tbody_tr]:border-b [&_tbody_tr]:border-[var(--edge)] [&_tbody_tr:last-child]:border-b-0",
+ "[&_th]:px-4 [&_th]:py-2 [&_th]:text-left [&_th]:font-medium [&_td]:px-4 [&_td]:py-2",
+ // margin reset for the container edges plus a width guard
+ "[&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_*]:max-w-full",
+].join(" ");
+
/**
* Present Markdown source using an injected rich renderer or the explicit
* dependency-free plain-source contract.
@@ -145,7 +179,7 @@ export function Markdown({
if (Renderer) {
return (
*:first-child]:mt-0",
+ "[&>*:last-child]:mb-0",
"[&>button]:w-full",
"[&>span]:line-clamp-1",
"[&>svg]:mt-0.5",
"[&>svg]:transition-transform",
+ "[&_*]:max-w-full",
"[&_.hljs]:bg-transparent",
"[&_.hljs]:p-0",
+ "[&_:not(pre)>code]:bg-[var(--accent)]",
+ "[&_:not(pre)>code]:font-medium",
+ "[&_:not(pre)>code]:font-mono",
+ "[&_:not(pre)>code]:px-1",
+ "[&_:not(pre)>code]:py-0.5",
+ "[&_:not(pre)>code]:rounded-[var(--radius-xs)]",
+ "[&_:not(pre)>code]:text-[0.9em]",
+ "[&_:not(pre)>code]:text-[var(--foreground)]",
+ "[&_em]:italic",
+ "[&_h1]:font-semibold",
+ "[&_h1]:mb-2",
+ "[&_h1]:mt-6",
+ "[&_h1]:text-lg",
+ "[&_h2]:font-semibold",
+ "[&_h2]:mb-2",
+ "[&_h2]:mt-5",
+ "[&_h2]:text-base",
+ "[&_h3]:font-semibold",
+ "[&_h3]:mb-1",
+ "[&_h3]:mt-4",
+ "[&_h3]:text-sm",
+ "[&_h4]:font-semibold",
+ "[&_h4]:mb-1",
+ "[&_h4]:mt-3",
+ "[&_h4]:text-sm",
+ "[&_hr]:border-0",
+ "[&_hr]:border-[var(--edge-medium)]",
+ "[&_hr]:border-t",
+ "[&_hr]:my-6",
+ "[&_li>p]:my-0",
+ "[&_li]:my-1.5",
+ "[&_li]:pl-1",
+ "[&_li_p]:my-2",
+ "[&_ol]:list-decimal",
+ "[&_ol]:my-4",
+ "[&_ol]:pl-6",
+ "[&_ol_ol]:my-1",
+ "[&_ol_ul]:my-1",
+ "[&_p]:my-4",
+ "[&_strong]:font-semibold",
"[&_svg]:!mr-0",
"[&_svg]:group-hover:translate-x-0.5",
"[&_svg]:ml-3.5",
@@ -6160,6 +6207,26 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"[&_svg]:size-5",
"[&_svg]:size-[1.125rem]",
"[&_svg]:transition-transform",
+ "[&_table]:border-collapse",
+ "[&_table]:my-4",
+ "[&_table]:text-sm",
+ "[&_table]:w-full",
+ "[&_tbody_tr:last-child]:border-b-0",
+ "[&_tbody_tr]:border-[var(--edge)]",
+ "[&_tbody_tr]:border-b",
+ "[&_td]:px-4",
+ "[&_td]:py-2",
+ "[&_th]:font-medium",
+ "[&_th]:px-4",
+ "[&_th]:py-2",
+ "[&_th]:text-left",
+ "[&_thead_tr]:border-[var(--edge)]",
+ "[&_thead_tr]:border-b",
+ "[&_ul]:list-disc",
+ "[&_ul]:my-4",
+ "[&_ul]:pl-6",
+ "[&_ul_ol]:my-1",
+ "[&_ul_ul]:my-1",
"[,",
"[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--background),#0000_calc(50%+var(--spread)))]",
"[...acc,",
@@ -7591,6 +7658,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"blobKeys(journal.id);",
"blobKeys(value.id).current;",
"block",
+ "block's",
"block.",
"block:",
"blocked,",
@@ -8015,6 +8083,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"cause:",
"cause;",
"causing",
+ "cells.",
"center",
"centered",
"centeredLeft",
@@ -10205,6 +10274,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"emitter),",
"emitting",
"emoji,",
+ "emphasis",
"empty",
"empty,",
"empty-state",
@@ -11428,6 +11498,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"hauls",
"havana",
"have",
+ "having",
"head>",
"header",
"header's",
@@ -11461,6 +11532,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"headingId",
"headingLevel",
"headingLevel?:",
+ "headings",
"heading}",
"headless",
"headless-hook",
@@ -11745,6 +11817,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"including",
"incoming,",
"incoming:",
+ "indentation",
"independent",
"indeterminate",
"indeterminate?:",
@@ -12720,6 +12793,8 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"list).",
"list);",
"list,",
+ "list-decimal",
+ "list-disc",
"list-request",
"list.",
"list.filter((t)",
@@ -12762,6 +12837,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"listeners)",
"listening.",
"listing",
+ "lists",
"lists,",
"lists/tables),",
"lists:",
@@ -12923,6 +12999,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"mapping",
"mapping,",
"maps",
+ "margin",
"margin:",
"margins",
"margins,",
@@ -12945,6 +13022,8 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"markdownComponents?:",
"marker",
"marker.",
+ "markers",
+ "markers,",
"marks",
"markup",
"markup).",
@@ -13671,6 +13750,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"normally",
"normally.",
"not",
+ "not(pre)>code",
"not).",
"not,",
"not-prose",
@@ -14642,6 +14722,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"panelRef,",
"panelRef.current;",
"panels",
+ "paragraph",
"parameters",
"params",
"params.set(key,",
@@ -14927,6 +15008,8 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"pluggable",
"pluggable;",
"plugin",
+ "plugin,",
+ "plugin.",
"plus",
"png:",
"point",
@@ -15015,6 +15098,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"prefix",
"prefix).",
"prefixed",
+ "preflight",
"presence:",
"present",
"present,",
@@ -16217,6 +16301,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"rewriting",
"rewritten.",
"rgba(0,",
+ "rhythm",
"rhythm).",
"rich",
"rich-Markdown",
@@ -16351,6 +16436,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"rule",
"rule.",
"rule:",
+ "rules",
"rules.",
"run",
"run();",
@@ -17653,6 +17739,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"string]:",
"strings",
"strings/numbers",
+ "strips",
"stroke:",
"stroke=",
"strokeLinecap:",
@@ -17910,6 +17997,7 @@ export const FRAMEWORK_CANDIDATES: readonly string[] = [
"table",
"table>",
"tableOutput",
+ "tables",
"tablist",
"tabs",
"tabs,",