Convert Html To Markdown 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-Parsehtml

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

This Package depends on league/html-to-markdown

Installation

$ composer require yansongda/laravel-parsehtml

Add service provider

<?php

Yansongda\LaravelParsehtml\ParsehtmlServiceProvider::class,

Add alias

<?php

'LaravelParsehtml' => Yansongda\LaravelParsehtml\Facades\Parsehtml::class,

Config(OPTION)

$ php artisan vendor:publish --provider="Yansongda\\LaravelParsehtml\\ParsehtmlServiceProvider" --tag=laravel-html-config
config desc
strip_tags strip HTML tags that don't have a Markdown equivalent
remove_nodes strip tags and their content
italic_style
bold_style
hard_break
header_style atx/etx

Reference: league/html-to-markdown

Usage

Using blade

<?php

@parsehtml('<h2>blablabla</h2>');

Using Helper

<?php

{{ parsehtml('<h2>blablabla</h2>') }}

License

MIT