Built with Dark Factory v4 — autonomous AI software development pipeline
A live Markdown preview web application built with Next.js 15 App Router. Users can type Markdown in the left panel and see a styled HTML preview update in real-time on the right panel.
- ⚡ Real-time preview - Updates as you type with 200ms debouncing
- 🎨 Dark theme - Beautiful dark UI with Tailwind CSS
- 📱 Mobile responsive - Panels stack vertically on small screens
- 🔒 Secure - HTML output is sanitized to prevent XSS attacks
- 📋 Copy to clipboard - One-click HTML copying
- 🚀 Modern stack - Next.js 15, React 19, TypeScript
- Headers (H1-H6)
- Bold and italic text
StrikethroughInline codeand code blocks with syntax highlighting- Links and images
- Tables (GitHub Flavored Markdown)
-
Blockquotes
- Ordered and unordered lists
- Task lists with checkboxes
- Horizontal rules
- Node.js 18.0.0 or higher
- npm (comes with Node.js)
- Clone the repository:
git clone <repository-url>
cd markdown-preview- Install dependencies:
npm install- Copy environment variables (optional):
cp .env.example .env.local- Start the development server:
npm run dev- Open http://localhost:3000 in your browser.
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run type-check- Run TypeScript compiler check
- GET
/api/health- Returns{ status: "ok" }
src/
├── app/
│ ├── layout.tsx # Root layout with dark theme
│ ├── page.tsx # Main page with MarkdownEditor
│ ├── globals.css # Global styles and prose overrides
│ └── api/
│ └── health/
│ └── route.ts # Health check endpoint
├── components/
│ ├── MarkdownEditor.tsx # Main editor component
│ └── SampleMarkdown.ts # Default markdown content
├── lib/
│ └── markdown.ts # Markdown processing utilities
└── types.ts # TypeScript type definitions
- Framework: Next.js 15 with App Router
- Language: TypeScript (strict mode)
- Styling: Tailwind CSS with @tailwindcss/typography
- Markdown Processing:
- unified
- remark-parse
- remark-gfm (GitHub Flavored Markdown)
- remark-rehype
- rehype-stringify
- rehype-sanitize
The application is fully responsive and tested at these breakpoints:
- Mobile: 320px and up (stacked layout)
- Tablet: 768px and up (side-by-side layout)
- Desktop: 1280px and up (optimized spacing)
- All HTML output is sanitized using
rehype-sanitize - No dangerous HTML elements or attributes are allowed
- XSS protection through content sanitization
- Modern browsers with ES2017+ support
- Clipboard API for copy functionality (with fallback)
- JavaScript required for functionality
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
MIT License - see LICENSE file for details.
Currently, no environment variables are required for basic functionality. See .env.example for future configuration options.
- Debounced input processing (200ms)
- Efficient re-rendering with React hooks
- Optimized bundle size with tree shaking
- Fast development with Next.js Hot Module Replacement
- Ensure Node.js version is 18.0.0 or higher
- Clear node_modules and reinstall:
rm -rf node_modules package-lock.json && npm install - Check TypeScript errors:
npm run type-check
- Check browser console for JavaScript errors
- Ensure JavaScript is enabled
- Try hard refresh (Ctrl+F5 or Cmd+Shift+R)
- Clipboard API requires HTTPS in production
- Fallback method available for older browsers
- Check browser permissions for clipboard access