
Research
Shai-Hulud Descends to Hades: Miasma Worm Campaign Spreads with New PyPI Wave
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.
@page-speed/markdown-to-jsx
Advanced tools
Performance-optimized, tree-shakable React markdown renderer for DashTrack ecosystem
markdown-to-jsx library (~6KB gzipped) with ecosystem-specific defaults: pre-configured overrides for @page-speed/img and @page-speed/pressable, prose-aware typography, and zero-CLS rendering. Used by the UI component library for the OpenSite Semantic Site Builder platform.
@page-speed/imgnpm install @page-speed/markdown-to-jsx
# or
pnpm add @page-speed/markdown-to-jsx
# or
yarn add @page-speed/markdown-to-jsx
For optimized image rendering, install @page-speed/img:
npm install @page-speed/img
import { Markdown } from "@page-speed/markdown-to-jsx";
function MyComponent() {
return (
<Markdown>
# Hello World
This is **bold** and this is *italic*.
[Link](https://example.com)
</Markdown>
);
}
<Markdown className="prose prose-lg">
# Styled Markdown
Your content here...
</Markdown>
import { useMarkdown } from "@page-speed/markdown-to-jsx/hooks";
function MyComponent() {
const { content } = useMarkdown("# Hello from hook!");
return <div>{content}</div>;
}
<Markdown> ComponentPrimary component for rendering markdown content.
interface MarkdownProps {
children: string;
className?: string;
wrapper?: string | ComponentType<any>;
overrides?: OverrideMap;
useDefaults?: boolean;
sanitize?: boolean;
}
Props:
children (required): Markdown string to renderclassName: Custom CSS class for the wrapper elementwrapper: Custom wrapper component (defaults to 'div')overrides: Custom component overridesuseDefaults: Enable default ecosystem overrides (default: true)sanitize: Enable HTML sanitization (default: true)useMarkdown HookHook for compiling markdown to JSX.
function useMarkdown(
markdown: string,
options?: MarkdownOptions
): UseMarkdownResult
Returns:
interface UseMarkdownResult {
content: ReactNode;
isCompiling: boolean;
error?: Error;
}
useMarkdownOptions HookHook for merging custom options with defaults.
function useMarkdownOptions(
options?: MarkdownOptions
): MarkdownOptions
You can override any HTML element with a custom React component:
import { Markdown } from "@page-speed/markdown-to-jsx";
const CustomH1 = ({ children, ...props }) => (
<h1 className="text-4xl font-bold text-blue-600" {...props}>
{children}
</h1>
);
function MyComponent() {
return (
<Markdown overrides={{ h1: CustomH1}}>
# Custom Heading Style
</Markdown>
);
}
The library includes these default overrides:
h1-h6): Auto-generated IDs for anchor linksimg): Integration with @page-speed/img for optimized loadinga): Automatic external link handling with security attributespre, code): Language detection and syntax highlighting supportImport only what you need for optimal bundle size:
// Import individual components
import { H1, H2 } from "@page-speed/markdown-to-jsx/overrides";
// Import specific utilities
import { slugify } from "@page-speed/markdown-to-jsx/utils";
// Import hooks
import { useMarkdown } from "@page-speed/markdown-to-jsx/hooks";
import { slugify, generateHeadingId } from "@page-speed/markdown-to-jsx/utils";
const slug = slugify("Hello World"); // "hello-world"
const id = generateHeadingId("Introduction"); // "introduction"
import { sanitizeUrl, sanitizeAttributes } from "@page-speed/markdown-to-jsx/utils";
const safeUrl = sanitizeUrl("javascript:alert('XSS')"); // "#"
const safeAttrs = sanitizeAttributes({ onclick: "alert('XSS')" }); // {}
import { Markdown } from "@page-speed/markdown-to-jsx";
function BlogPost({ content }) {
return (
<article className="prose prose-lg max-w-none">
<Markdown>{content}</Markdown>
</article>
);
}
import { Markdown } from "@page-speed/markdown-to-jsx";
function DocsPage({ markdown }) {
return (
<div className="documentation">
<Markdown
className="docs-content"
overrides={{
h1: ({ children }) => (
<h1 className="docs-heading-1">{children}</h1>
),
code: ({ children }) => (
<code className="docs-code">{children}</code>
),
}}
>
{markdown}
</Markdown>
</div>
);
}
import { useMarkdown } from "@page-speed/markdown-to-jsx/hooks";
function DynamicContent({ markdownSource }) {
const { content, isCompiling, error } = useMarkdown(markdownSource);
if (isCompiling) return <div>Loading...</div>;
if (error) return <div>Error: {error.message}</div>;
return <div>{content}</div>;
}
The library includes built-in security features:
javascript:, data:, vbscript:)rel="noopener noreferrer"Full TypeScript support with comprehensive type definitions:
import type {
MarkdownProps,
MarkdownOptions,
OverrideMap
} from "@page-speed/markdown-to-jsx";
MIT
See BUILD_GUIDE.md for development instructions.
https://github.com/opensite-ai/markdown-to-jsx
The library supports custom heading IDs using the {#id} syntax, which is commonly used by AI LLMs and extended markdown parsers:
<Markdown>
{`
## Introduction {#intro}
Content here... can link to [Introduction](#intro)
## Getting Started {#getting-started}
More content...
`}
</Markdown>
Output:
<h2 id="intro">Introduction</h2>
<p>Content here... can link to <a href="#intro">Introduction</a></p>
<h2 id="getting-started">Getting Started</h2>
Features:
Apply custom Tailwind classes to markdown elements without creating custom components:
<Markdown
markdownStyles={{
h2: 'text-2xl md:text-4xl font-bold text-primary',
h3: 'text-xl md:text-2xl font-semibold',
img: 'shadow-lg rounded-2xl aspect-video',
iframe: 'aspect-video w-full rounded-2xl shadow-lg my-12',
p: 'text-base md:text-lg leading-relaxed',
blockquote: 'border-l-4 border-primary pl-4 italic',
}}
>
{markdownContent}
</Markdown>
Supported Elements:
h1, h2, h3, h4, h5, h6p, blockquote, code, preimg, iframeul, ol, litable, thead, tbody, tr, th, tdaThe library now includes built-in iframe support for embeds (YouTube, Twitter, Spotify, etc.):
<Markdown
markdownStyles={{
iframe: 'aspect-video w-full rounded-lg shadow-md my-8'
}}
>
{`
## Video Tutorial
<iframe
src="https://www.youtube.com/embed/VIDEO_ID"
title="Tutorial Video"
></iframe>
Content continues...
`}
</Markdown>
Default iframe attributes:
loading="lazy" - Lazy loading for performanceallowFullScreen - Enables fullscreen modeAll features work together seamlessly:
<Markdown
markdownStyles={{
h2: 'text-3xl font-bold text-primary mb-6',
img: 'rounded-xl shadow-lg',
iframe: 'aspect-video w-full rounded-2xl my-12',
}}
overrides={{
a: CustomLinkComponent, // Use custom component for links
}}
>
{`
## Video Section {#videos}
Watch our tutorial below:
<iframe src="https://youtube.com/embed/abc123"></iframe>

For questions, email us at support@example.com or call (555) 123-4567.
`}
</Markdown>
What happens:
id="videos" + custom styling@page-speed/img with responsive formats + custom stylingmailto:support@example.comtel:+15551234567FAQs
Performance-optimized, tree-shakable React markdown renderer for DashTrack ecosystem
We found that @page-speed/markdown-to-jsx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.