yansongda / laravel-parsehtml by yansongda

Convert Html To Markdown With Laravel
2,994
4
2
Package Data
Maintainer Username: yansongda
Maintainer Contact: me@yansongda.cn (yansongda)
Package Create Date: 2017-09-04
Package Last Update: 2018-12-10
Language: PHP
License: MIT
Last Refreshed: 2024-11-19 03:07:22
Package Statistics
Total Downloads: 2,994
Monthly Downloads: 1
Daily Downloads: 0
Total Stars: 4
Total Watchers: 2
Total Forks: 2
Total Open Issues: 0

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