Download the PHP package vlotysh/markdown-parser without Composer
On this page you can find all versions of the php package vlotysh/markdown-parser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package markdown-parser
Markdown Parser
A simple and fast PHP library for converting Markdown to HTML.
⚠️ Development Status
This library is in early development (v0.x.x). The API may change between minor versions until v1.0.0.
Installation
Quick Start
Supported Elements
Headers
Text Formatting
Lists
Links and Images
Blockquotes
Code Blocks
`
Tables
Horizontal Rules
Configuration
Options
- breaks (bool, default: false) - Converts line breaks to
<br>tags - gfm (bool, default: true) - Enables GitHub Flavored Markdown support (strikethrough)
- tables (bool, default: true) - Enables table support
- sanitize (bool, default: true) - Removes potentially dangerous HTML tags
Usage Examples
Basic Usage
php echo "Hello World";
With Custom Settings
Framework Integration
Laravel
Symfony
Testing
Performance
The library is optimized for speed and minimal memory usage:
- Single-pass parsing
- No recursive calls
- Minimal regular expression usage
- Lazy parser initialization
Approximate performance:
- 1000 lines of markdown ≈ 5ms
- 10000 lines of markdown ≈ 50ms
Security
By default, the library sanitizes potentially dangerous HTML tags:
<script><style><iframe><object><embed><form>
To disable sanitization:
Extending Functionality
Creating Custom Parser
Requirements
- PHP 8.2 or higher
- Composer
License
MIT License. See LICENSE file for details.
Development
Project Structure
Contributing
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Roadmap
- [ ] Footnotes support
- [ ] Definition lists support
- [ ] Math expressions support
- [ ] Plugin architecture
- [ ] Result caching
- [ ] Advanced sanitization
Comparison with Other Libraries
| Feature | Our Library | Parsedown | CommonMark |
|---|---|---|---|
| Size | ~50KB | ~100KB | ~500KB |
| Speed | Fast | Medium | Slow |
| PHP 8 | ✅ | ❌ | ✅ |
| Configuration | ✅ | Limited | ✅ |
| Tables | ✅ | ✅ | Via extensions |
Support
- 📧 Email: [email protected]
- 🐛 Issues: GitHub Issues
- 💬 Discussions: GitHub Discussions
All versions of markdown-parser with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.2
The package vlotysh/markdown-parser contains the following files
Loading the files please wait ...