diff --git a/packages/stack/src/plugins/blog/client/components/shared/markdown-content.tsx b/packages/stack/src/plugins/blog/client/components/shared/markdown-content.tsx
index 7b8c34d72..279aad028 100644
--- a/packages/stack/src/plugins/blog/client/components/shared/markdown-content.tsx
+++ b/packages/stack/src/plugins/blog/client/components/shared/markdown-content.tsx
@@ -1,5 +1,6 @@
"use client";
+import type { ReactNode } from "react";
import { MarkdownContent as SharedMarkdownContent } from "@workspace/ui/components/markdown-content";
import { useStack } from "@btst/stack/context";
import { DefaultImage, DefaultLink } from "./defaults";
@@ -11,6 +12,7 @@ import "highlight.js/styles/panda-syntax-light.css";
export type MarkdownContentProps = {
markdown: string;
className?: string;
+ afterFirstParagraph?: ReactNode;
};
/**
@@ -18,7 +20,11 @@ export type MarkdownContentProps = {
* This is a thin wrapper around the shared MarkdownContent component
* that provides the framework-wide Link and Image components.
*/
-export function MarkdownContent({ markdown, className }: MarkdownContentProps) {
+export function MarkdownContent({
+ markdown,
+ className,
+ afterFirstParagraph,
+}: MarkdownContentProps) {
const { router } = useStack();
const Link = router?.Link ?? DefaultLink;
const Image = router?.Image ?? DefaultImage;
@@ -26,6 +32,7 @@ export function MarkdownContent({ markdown, className }: MarkdownContentProps) {
return (
ReactNode;
+
+ /** Render content after the first top-level body paragraph, preserving a single Markdown document. Omitted if no paragraph exists. */
+ postIntroductionSlot?: (post: SerializedPost) => ReactNode;
}
diff --git a/packages/ui/src/components/markdown-content.tsx b/packages/ui/src/components/markdown-content.tsx
index 81386b2c8..47d38b99b 100644
--- a/packages/ui/src/components/markdown-content.tsx
+++ b/packages/ui/src/components/markdown-content.tsx
@@ -3,6 +3,8 @@
import { cn } from "../lib/utils";
import {
createElement,
+ createContext,
+ useContext,
isValidElement,
useMemo,
useRef,
@@ -16,12 +18,32 @@ import type {
ReactNode,
} from "react";
import ReactMarkdown from "react-markdown";
-import type { Components } from "react-markdown";
+import type { Components, ExtraProps } from "react-markdown";
import rehypeHighlight from "rehype-highlight";
import rehypeRaw from "rehype-raw";
import remarkGfm from "remark-gfm";
import { CopyIcon, CheckIcon } from "lucide-react";
+const IntroductionSlotContext = createContext(null);
+
+function ParagraphRenderer({
+ node,
+ children,
+ ...props
+}: ComponentPropsWithoutRef<"p"> & ExtraProps) {
+ const slot = useContext(IntroductionSlotContext);
+ return (
+ <>
+ {children}
+ {node?.data &&
+ "btstIntroduction" in node.data &&
+ node.data.btstIntroduction === true
+ ? slot
+ : null}
+ >
+ );
+}
+
// Default Link component
const DefaultLink = (props: React.ComponentProps<"a">) => {
return ;
@@ -243,9 +265,18 @@ function PreRenderer(props: React.HTMLAttributes) {
);
}
+function markIntroduction() {
+ return (tree: { children: { type: string; tagName?: string; data?: Record }[] }) => {
+ const paragraph = tree.children.find(node => node.type === "element" && node.tagName === "p");
+ if (paragraph) paragraph.data = { ...paragraph.data, btstIntroduction: true };
+ };
+}
+
export type MarkdownContentProps = {
/** The markdown string to render */
markdown: string;
+ /** Content inserted after the first top-level paragraph. Omitted when there is no paragraph. */
+ afterFirstParagraph?: ReactNode;
/** Additional CSS class name */
className?: string;
/** Variant for different use cases - 'default' for full blog posts, 'chat' for compact chat messages */
@@ -258,6 +289,7 @@ export type MarkdownContentProps = {
export function MarkdownContent({
markdown,
+ afterFirstParagraph,
className,
variant = "default",
LinkComponent = DefaultLink,
@@ -384,6 +416,7 @@ export function MarkdownContent({
const components = useMemo(() => {
return {
+ p: ParagraphRenderer,
a: AnchorRenderer,
img: ImgRenderer,
span: ({ node: _node, className, ...props }) => (
@@ -414,7 +447,7 @@ export function MarkdownContent({
}, [hasMath, mathPlugins]);
const rehypePlugins = useMemo(() => {
- const plugins: unknown[] = [rehypeRaw, rehypeHighlight];
+ const plugins: unknown[] = [rehypeRaw, rehypeHighlight, markIntroduction];
if (hasMath && mathPlugins?.rehypeKatex) {
plugins.push(mathPlugins.rehypeKatex);
}
@@ -427,13 +460,15 @@ export function MarkdownContent({
-
- {markdown}
-
+
+
+ {markdown}
+
+
diff --git a/playground/src/lib/stackblitz-template.ts b/playground/src/lib/stackblitz-template.ts
index a60307f22..ce852667c 100644
--- a/playground/src/lib/stackblitz-template.ts
+++ b/playground/src/lib/stackblitz-template.ts
@@ -25,7 +25,7 @@ function buildNextjsProjectFiles(
): ProjectFiles {
const cssImportLines = cssImports.map((c) => `@import "${c}";`).join("\n");
const baseDependencies: Record = {
- "@btst/stack": "4.5.1",
+ "@btst/stack": "4.6.0",
"@btst/adapter-memory": "3.0.0",
"@btst/yar": "1.3.2",
"@tanstack/react-query": "5.102.0",
@@ -456,7 +456,7 @@ function buildReactRouterProjectFiles(
);
const baseDependencies: Record = {
"@btst/adapter-memory": "3.0.0",
- "@btst/stack": "4.5.1",
+ "@btst/stack": "4.6.0",
"@btst/yar": "1.3.2",
"@react-router/node": "^7.0.0",
"@react-router/serve": "^7.0.0",
@@ -810,7 +810,7 @@ function buildTanstackProjectFiles(
);
const baseDependencies: Record = {
"@btst/adapter-memory": "3.0.0",
- "@btst/stack": "4.5.1",
+ "@btst/stack": "4.6.0",
"@btst/yar": "1.3.2",
"@tailwindcss/postcss": "^4.3.2",
"@tanstack/react-query": "5.102.0",
diff --git a/scripts/packed-consumer/README.md b/scripts/packed-consumer/README.md
index 981fd5d7e..244ee3cfb 100644
--- a/scripts/packed-consumer/README.md
+++ b/scripts/packed-consumer/README.md
@@ -3,13 +3,9 @@
The npm and pnpm fixtures install separately packed packages with strict peer
validation, inspect dependency trees, typecheck public APIs, and build a consumer.
-The auth fixture explicitly declares `@react-email/render@2.0.6`, the renderer
-used by `@react-email/components@1.0.12` in Better Auth UI 2.0.0. Without this direct
-dependency, npm 10 and 11 select react-dom 19.3.0 for the nested renderer peer set
-before reconciling the consumer's React/React DOM 19.2.8 pair, producing ERESOLVE.
-The failure reproduces with only React, React DOM, and React Email Components;
-it is not specific to packed BTST artifacts. A published-package consumer using
-that React/React Email combination can also be affected. Declaring the matching
-renderer directly resolves that graph without overrides, force, or relaxed peers.
-The fixture retains React/React DOM 19.2.8 and validates npm and pnpm installation,
-types, and builds. It does not change the published packages' React peer ranges.
+The fixtures use React and React DOM 19.3.1. With the previous 19.2.8 pair, npm 10
+and 11 reject the current Better Auth/Drizzle graph while resolving optional
+native driver peers: React Native 0.88.0 requires React 19.3. Updating the fixture
+pair resolves that graph without overrides, force, or relaxed peer validation.
+Workspace tests still use React 19.2.7. This fixture update does not change the
+published packages' React peer ranges.
diff --git a/scripts/packed-consumer/runner.mjs b/scripts/packed-consumer/runner.mjs
index 271540fe0..b332113c1 100644
--- a/scripts/packed-consumer/runner.mjs
+++ b/scripts/packed-consumer/runner.mjs
@@ -69,8 +69,8 @@ const CORE_DEPENDENCIES = Object.freeze({
"highlight.js": "11.11.1",
katex: "0.16.35",
"lucide-react": "1.7.0",
- react: "19.2.8",
- "react-dom": "19.2.8",
+ react: "19.3.1",
+ "react-dom": "19.3.1",
"react-error-boundary": "4.1.2",
"react-hook-form": "7.66.1",
"react-markdown": "9.1.0",