Convert Markdown To Html With Laravel
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
src
.gitignore
LICENSE
README.md
composer.json

README.md

Laravel-Parsedown

Scrutinizer Code Quality Build Status Latest Stable Version Total Downloads Latest Unstable Version License

This Package depends on erusev/parsedown

Requirement

  • composer
  • laravel | lumen >= 5.1

Installation

$ composer require yansongda/laravel-parsedown

Add service provider(if laravel<5.5 || lumen)

<?php

Yansongda\LaravelParsedown\ParsedownServiceProvider::class,

// lumen
// $app->register(Yansongda\LaravelParsedown\ParsedownServiceProvider::class);
// $app->withFacades();

Add alias(if laravel<5.5)

<?php

'LaravelParsedown' => Yansongda\LaravelParsedown\Facades\Parsedown::class,

Config(OPTION)

$ php artisan vendor:publish --provider="Yansongda\\LaravelParsedown\\ParsedownServiceProvider" --tag=laravel-parsedown-config

Lumen user please manually copy the configuration file

config desc default
breaksEnabled automatic line breaks true
markupEscaped escapes markup (HTML) true
urlsLinked automatic linking of URLs true
safeMode safeMode false

Reference: erusev/parsedown

Usage

Using blade

<?php

@parsedown('## h2');

Using Helper

<?php

{{ parsedown('## h2') }}

License

MIT