Skip to content

Conversation

@MujahidAbbas
Copy link
Owner

Summary

  • Markdown Preview: Added write/preview/split editor modes for PRD and Tech Spec documents
  • Syntax Highlighting: Implemented highlight.js with support for JavaScript, TypeScript, PHP, Python, SQL, Bash, JSON, XML, HTML, CSS, YAML, and Markdown
  • Code Block Enhancements: Added language labels and copy-to-clipboard functionality for all code blocks
  • GFM Support: Full GitHub Flavored Markdown support including tables, task lists, strikethrough, and autolinks
  • Security: XSS protection by stripping raw HTML and dangerous tags
  • Version History: Enhanced version preview to render markdown instead of raw text

Changes

New Files

  • app/Services/MarkdownService.php - Markdown rendering using league/commonmark
  • app/Livewire/Concerns/HasMarkdownPreview.php - Trait for editor mode management
  • resources/views/components/markdown-editor.blade.php - Reusable editor component
  • resources/js/code-block-enhancer.js - Alpine.js component for syntax highlighting

Dependencies Added

  • league/commonmark (PHP) - Markdown parsing
  • @tailwindcss/typography (npm) - Prose styling
  • highlight.js (npm) - Syntax highlighting

Test Plan

  • Unit tests for MarkdownService (11 tests)
  • Feature tests for markdown preview functionality (10 tests)
  • Verified write/preview/split modes work correctly
  • Tested code block copying on both HTTPS and HTTP
  • Confirmed XSS protection strips dangerous HTML

- Add MarkdownService using league/commonmark with GFM support
- Create markdown-editor Blade component with write/preview/split modes
- Implement code block enhancer with highlight.js syntax highlighting
- Add copy-to-clipboard functionality for code blocks
- Create HasMarkdownPreview trait for Livewire components
- Update PRD and Tech tabs to use new markdown-editor component
- Style markdown preview with Tailwind typography plugin
- Add comprehensive unit and feature tests
@MujahidAbbas MujahidAbbas merged commit 341a011 into main Jan 11, 2026
1 of 2 checks passed
@MujahidAbbas MujahidAbbas deleted the feature/markdown-preview-improvements branch January 11, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants