diff options
author | Mario <mario@mariovavti.com> | 2019-11-08 09:46:23 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2019-11-08 10:47:28 +0100 |
commit | bcd0802ea4a23971b5d53892c7de4e9e1822309f (patch) | |
tree | d63be67b6c55f2f17496e8b4fc1796cb88b7960e /vendor/league/html-to-markdown/README.md | |
parent | 9360148829bb32351d40b2b552ea40ea3878b3b5 (diff) | |
download | volse-hubzilla-bcd0802ea4a23971b5d53892c7de4e9e1822309f.tar.gz volse-hubzilla-bcd0802ea4a23971b5d53892c7de4e9e1822309f.tar.bz2 volse-hubzilla-bcd0802ea4a23971b5d53892c7de4e9e1822309f.zip |
update composr libs
(cherry picked from commit 2df15f35d706d4608ff723ce6288391ca774f7ba)
Diffstat (limited to 'vendor/league/html-to-markdown/README.md')
-rw-r--r-- | vendor/league/html-to-markdown/README.md | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/vendor/league/html-to-markdown/README.md b/vendor/league/html-to-markdown/README.md index ab80541e6..c7ae2dcab 100644 --- a/vendor/league/html-to-markdown/README.md +++ b/vendor/league/html-to-markdown/README.md @@ -28,7 +28,7 @@ Typically you would convert HTML to Markdown if: 1. You have an existing HTML document that needs to be edited by people with good taste. 2. You want to store new content in HTML format but edit it as Markdown. -3. You want to convert HTML email to plain text email. +3. You want to convert HTML email to plain text email. 4. You know a guy who's been converting HTML to Markdown for years, and now he can speak Elvish. You'd quite like to be able to speak Elvish. 5. You just really like Markdown. @@ -95,6 +95,24 @@ $html = '<span>Turnips!</span><div>Monkeys!</div>'; $markdown = $converter->convert($html); // $markdown now contains "" ``` +By default, all comments are stripped from the content. To preserve them, use the `preserve_comments` option, like this: + +```php +$converter = new HtmlConverter(array('preserve_comments' => true)); + +$html = '<span>Turnips!</span><!-- Monkeys! -->'; +$markdown = $converter->convert($html); // $markdown now contains "Turnips!<!-- Monkeys! -->" +``` + +To preserve only specific comments, set `preserve_comments` with an array of strings, like this: + +```php +$converter = new HtmlConverter(array('preserve_comments' => array('Eggs!'))); + +$html = '<span>Turnips!</span><!-- Monkeys! --><!-- Eggs! -->'; +$markdown = $converter->convert($html); // $markdown now contains "Turnips!<!-- Eggs! -->" +``` + ### Style options By default bold tags are converted using the asterisk syntax, and italic tags are converted using the underlined syntax. Change these by using the `bold_style` and `italic_style` options. @@ -161,7 +179,7 @@ $markdown = $converter->convert($html); // $markdown now contains "### Header" a Headers of H3 priority and lower always use atx style. -- Links and images are referenced inline. Footnote references (where image src and anchor href attributes are listed in the footnotes) are not used. +- Links and images are referenced inline. Footnote references (where image src and anchor href attributes are listed in the footnotes) are not used. - Blockquotes aren't line wrapped – it makes the converted Markdown easier to edit. ### Dependencies @@ -193,4 +211,3 @@ Use one of these great libraries: - [Parsedown](https://github.com/erusev/parsedown) No guarantees about the Elvish, though. - |