Download the PHP package kudashevs/laravel-parsedown without Composer
On this page you can find all versions of the php package kudashevs/laravel-parsedown. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kudashevs/laravel-parsedown
More information about kudashevs/laravel-parsedown
Files in kudashevs/laravel-parsedown
Package laravel-parsedown
Short Description A Laravel Parsedown wrapper that converts Mardown text into HTML.
License MIT
Homepage https://github.com/kudashevs/kudashevs/laravel-parsedown
Informations about the package laravel-parsedown
Laravel Parsedown
This is a Laravel Parsedown wrapper. If you want to know more about Parsedown, check out the official repo.
Installation
You can install the package via composer:
Features
- Configuration File
- Blade Directive
- Helper Function
Configuration
If you don't use auto-discovery, just add a ParsedownServiceProvider to the config/app.php
This package uses the ParsedownServiceProvider
service provider to create a singleton with a Parsedown instance. This
instance is stored in the container under the parsedown
name. To change the behavior of this instance, use the following options:
Name | Description | Default |
---|---|---|
enable_extra |
Instantiates ParsedownExtra class instead of Parsedown. | false |
safe_mode |
Processes untrusted user-input. | true |
enable_breaks |
Converts line breaks such as \n into <br /> tags. |
false |
escape_markup |
Escapes HTML in trusted input. Redundant if safe_mode is enabled. |
false |
link_urls |
Automatically converts URLs into anchor tags. | true |
inline |
Tells the parsedown() helper and @parsedown directive to use inline parsing by default. |
false |
You can overwrite these values by publishing the config/parsedown.php
file with the following command:
Usage
The code below shows how the laravel-parsedown
can be used in *.blade.php
files:
...or using the helper instead:
These examples are going to convert Markdown into this HTML code:
If you want to use the inline parsing style, you just need to set the second argument as true
:
...or using the helper instead:
The parsing style examples are going to generate:
The helper is globally available and can also be used with PHP code throughout your project.
License
The MIT License (MIT). Please see the License file for more information.