originphp / markdown
OriginPHP Markdown
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/originphp/markdown
Requires
- php: >=7.3.0
- originphp/html: ^2.0
Requires (Dev)
- phpstan/phpstan: ^0.12.64
- phpunit/phpunit: ^9.2
This package is auto-updated.
Last update: 2025-10-04 20:41:02 UTC
README
The Markdown utility gives you useful functions for converting to and from markdown.
Installation
To install this package
$ composer require originphp/markdown
Convert markdown To HTML
To convert HTML to markdown
$html = Markdown::toHtml($markdown);
By default markdown is escaped before converting to HTML this prevents people putting malicious HTML code. You can disable this by passing the options array with escape
set to false.
Markdown::toHtml($markdown,['escape'=>false]);
Convert markdown To Text
To convert markdown to text:
$text = Markdown::toText($markdown);
Convert to markdown From HTML
To convert HTML to markdown.
$markdown = Markdown::fromHtml($html);