2017 © Pedro Peláez
 

package parsedown-extra-laravel

A Parsedown Extra package for Laravel and Lumen

image

alfredo-ramos/parsedown-extra-laravel

A Parsedown Extra package for Laravel and Lumen

  • Sunday, May 20, 2018
  • by AlfredoRamos
  • Repository
  • 4 Watchers
  • 20 Stars
  • 46,239 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 28 Versions
  • 9 % Grown

The README.md

About

A Parsedown Extra package for Laravel and Lumen., (*1)

HTML Purifier is also used to filter the HTML output, protecting your application for insecure content. Additionally, HTML5 Definitions for HTML Purifier is used to add new definitions and sanitization for HTML5., (*2)

Build Status Latest Stable Version Code Quality License, (*3)

Compatibility

Version Laravel Lumen Status
0.8.x >= 5.5.x, < 6.x.x >= 5.5.x, < 6.x.x End of life
1.x.x 6.x.x 6.x.x End of life
2.x.x 7.x.x 7.x.x End of life
3.x.x 8.x.x 8.x.x End of life
4.x.x 9.x.x 9.x.x Security fixes only
5.x.x 10.x.x 10.x.x Active support

Installation

Open your composer.json file and add the package in the require object:, (*4)

"alfredo-ramos/parsedown-extra-laravel": "^5.0.0"

Then run composer update on your terminal., (*5)

Laravel

Service providers and aliases will be registered automatically since Laravel 5.5.x, thanks to the new package auto-discovery., (*6)

Lumen

In your bootstrap\app.php file and register the service provider:, (*7)

$app->register(AlfredoRamos\ParsedownExtra\ParsedownExtraServiceProvider::class);

Then register the facade alias:, (*8)

$app->withFacades(true, [
    AlfredoRamos\ParsedownExtra\Facades\ParsedownExtra::class => 'Markdown'
]);

Usage

The Markdown::parse() method is responsible to transform the Markdown syntax into HTML, its signature is the following:, (*9)

Markdown::parse(string $text = '', array $config = [])
Parameter Data type Default value Required Description
$text string '' Yes Markdown text
$config array, string [] No Extra configuration for HTML Purifier

Notes:, (*10)

  • If $config is a string, it will be trated as an array key in the [purifier][settings] array.
  • If $config is an array it will extend default configuration for HTML Purifier.
  • An empty value for $config means that it will use default values for HTML Purifier, see \AlfredoRamos\ParsedownExtra\HTMLPurifierLaravel::getConfig() for more information.

Using $config as a string, (*11)

Markdown::parse('Hello world', ['config' => 'comments'])

Where comments is the key of the array settings., (*12)

return [
    'purifier'  => [
        'enabled'   => true,
        'settings'  => [
            'default' => [...],
            'comments' => [...]
        ]
    ]
];

Using $config as an array, (*13)

Markdown::parse('[DuckDuckGo](https://duckduckgo.com/)', ['config' => [
    'URI.Host' => 'localhost',
    'URI.DisableExternal' => true
]])

For all configuration options see the official HTML Purifier config docs., (*14)

Using default settings, (*15)

Markdown::parse('Hello world!')
// Is the same as
Markdown::parse('Hello world!', ['config' => 'default'])

Blade

It can be used in Blade through the Markdown facade:, (*16)

{!! Markdown::parse("Hello world") !!}
{!! Markdown::parse("[XSS link](javascript:alert('xss'))") !!}

The code above will print:, (*17)



Hello world, (*18)

XSS link, (*19)

XSS link, (*20)

Helper

For your convenience, the markdown() helper function is also available. It accepts the same parameters as the facade., (*21)

markdown('Hello world', ['purifier' => false])

Configuration

To add new or edit the default options, run the following command to make a copy of the default configuration file:, (*22)

php artisan vendor:publish \
    --provider='AlfredoRamos\ParsedownExtra\ParsedownExtraServiceProvider' \
    --tag=config --force

The Versions

20/05 2018

dev-master

9999999-dev https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel and Lumen

  Sources   Download

GPL-3.0+ GPL-3.0-or-later

The Requires

 

The Development Requires

laravel lumen markdown laravel 5 markdown extra parsedown extra parsedown markdown-extra parsedown-extra

12/02 2018

0.8.0

0.8.0.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel and Lumen

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel lumen markdown parsedown markdown-extra parsedown-extra

31/08 2017

0.7.0

0.7.0.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

27/08 2017

0.7.x-dev

0.7.9999999.9999999-dev https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

10/04 2017

0.6.2

0.6.2.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

27/02 2017

0.6.1

0.6.1.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

02/02 2017

0.6.0

0.6.0.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

14/01 2017

0.5.2

0.5.2.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5.3.x

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

26/08 2016

0.5.1

0.5.1.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5.3.x

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

24/08 2016

0.5.0

0.5.0.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5.3.x

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

16/08 2016

0.4.2

0.4.2.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5.2.x

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

11/06 2016

0.4.1

0.4.1.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5.2.x

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

29/01 2016

0.4.0

0.4.0.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5.2.x

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

10/11 2015

0.3.0

0.3.0.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5.1.x

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

23/07 2015

0.2.8

0.2.8.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

10/07 2015

0.2.7

0.2.7.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

03/07 2015

0.2.6

0.2.6.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

02/07 2015

0.2.5

0.2.5.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

24/05 2015

0.2.4

0.2.4.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel 5 markdown extra parsedown extra

18/05 2015

0.2.3

0.2.3.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra package for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel parser markdown laravel 5 markdown extra parsedown extra parsedown

11/04 2015

0.2.2

0.2.2.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra wrapper for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel parser markdown laravel 5 markdown extra parsedown extra parsedown

05/02 2015

0.2.1

0.2.1.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra wrapper for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel parser markdown laravel 5 markdown extra parsedown extra parsedown

05/02 2015

0.2.0

0.2.0.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra wrapper for Laravel 5

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel parser markdown laravel 5 markdown extra parsedown extra parsedown

31/01 2015

0.1.2

0.1.2.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra wrapper for Laravel 4

  Sources   Download

GPL-3.0+

The Requires

 

The Development Requires

laravel parser laravel 4 markdown markdown extra parsedown extra parsedown

29/01 2015

0.1.1

0.1.1.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra wrapper for Laravel 4

  Sources   Download

GPLv3

The Requires

 

laravel parser laravel 4 markdown markdown extra parsedown extra parsedown

14/01 2015

0.1.0

0.1.0.0 https://github.com/AlfredoRamos/parsedown-extra-laravel

A Parsedown Extra wrapper for Laravel 4

  Sources   Download

GPLv3

The Requires

 

laravel parser laravel 4 markdown markdown extra parsedown extra parsedown