pstaender / silverstripe-markdown-parser
Transforms markdown and markdown extra to HTML and vice versa
Installs: 523
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 1
Type:silverstripe-vendormodule
pkg:composer/pstaender/silverstripe-markdown-parser
Requires
- php: >=8
- erusev/parsedown: ^1.7
- erusev/parsedown-extra: ^0.7.1
- league/html-to-markdown: ^5
- silverstripe/framework: ~4
- soundasleep/html2text: ^1.1
Requires (Dev)
README
Converts any string field to Markdown and vice versa.
Requirements
- Silverstripe 4+
Installation
Install with composer:
$ composer require pstaender/silverstripe-markdown-parser
Usage
After flushing your cache you can use the convertes in any template:
<article> $Content.markdown $Content.markdownExtra <p> $Title.inlineMarkdown </p> <p> $Title.inlineMarkdownExtra </p> <pre> $MyHTMLContent.htmlToMarkdown </pre> </article>
Configuration
Every converting should work as expected out of the box.
Under the hood the parsers Parsedown, ParsedownExtra and League\HTMLToMarkdown\HtmlConverter are used for conversion. Anyhow, if you need to different parsing options you can hook any parser with a custom Injector configuration.
License
MIT License