{"repo":"thephpleague/html-to-markdown","free":true,"listed":false,"github":"https://github.com/thephpleague/html-to-markdown","clone":"git clone https://github.com/thephpleague/html-to-markdown.git","description":"Convert HTML to Markdown with PHP","language":"PHP","stars":1903,"topics":["php","markdown","commonmark","html","converter","phpleague","hacktoberfest"],"license":"MIT","category":"productivity","readme_excerpt":"HTML To Markdown for PHP ======================== Library which converts HTML to Markdown for your sanity and convenience. Requires : PHP 7.2+ Lead Developer : @colinodell Original Author : @nickcernis Why convert HTML to Markdown? \"What alchemy is this?\" you mutter. \"I can see why you'd convert Markdown to HTML,\" you continue, already labouring the question somewhat, \"but why go the other way?\" 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. 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. How to use it Require the library by issuing this command: Add require 'vendor/autoload.php'; to the top of your script. Next, create a new HtmlConverter instance, passing in your valid HTML code to its convert() function: The $markdown variable now contains the Markdown version of your HTML as a string: The included demo directory contains an HTML- Markdown conversion form to try out. Conversion options [!CAUTION] By default, this library preserves HTML tags without Markdown equivalents, like , , , , etc. If you will be parsing untrusted input from users, please consider setting the strip tags and/or remove nodes options documented below, and also us","default_branch":null,"files":null,"tree":[],"storefront":"/r/thephpleague","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/thephpleague/html-to-markdown/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}