league/html-to-markdown
Convert HTML to Markdown in PHP with league/html-to-markdown. Create an HtmlConverter, pass valid HTML to convert(), and get clean Markdown back. Useful for editing legacy HTML, storing content as HTML while authoring in Markdown, and turning HTML email into plain text.
<pre> tags with attributes not being parsed (#215, #238)Element::getValue() not handling possible nullsstrip_placeholder_links option to strip <a> tags without href attributes (#196)ElementInterface:
hasParent()getNextSibling()getPreviousSibling()getListItemLevel()PreConverterInterface to allow converters to perform any necessary pre-parsingHtmlConverter::convert() may now throw a \RuntimeException when unexpected DOMDocument-related errors occur<code> tags (#174, #178)HtmlConverterInterface) for the main HtmlConverter classitalic_style option now defaults to '*' so that in-word emphasis is handled properly (#75)<code> and <pre> tags not converting to blocks or inlines properly (#26, #70, #102, #140, #161, #162)<div> elementsbold_style and italic_style options have been deprecated (#75)setOptions() function for chainable calling (#149)list_item_style_alternate option for converting every-other list with a different character (#155)<pre> tags (#145)hard_break configuration option (#112, #115)HtmlConverter can now be instantiated with an Environment (#118)br elements (#116, #117)<pre> and <pre><code> conversions to use backticks instead of indendation (#102)<code> tags nested in <pre> was not converted properly (#70, #102)preg_replace so it wouldn't break UTF-8 characters (#79)bin/html-to-markdown script_ (#58).styleci.yml and CONTRIBUTING.md are no longer included in distributions (#50)This release changes the visibility of several methods/properties. #42 and #43 brought to light that some visiblities were not ideally set, so this releases fixes that. Moving forwards this should reduce the chance of introducing BC-breaking changes.
HtmlConverter::getEnvironment() method to expose the Environment (#42, #43)Environment::addConverter() from protected to public, enabling custom converters to be added (#42, #43)HtmlConverter::createDOMDocument() from protected to privateElement::nextCached from protected to privateEnvironment class finalequals method to Element to check for equalityLeague\HTMLToMarkdownleague/html-to-markdown<a> tags with identical href and inner text are now rendered using angular bracket syntax (#31)<div> elements are now treated as block-level elements (#33)<pre> blocks are now treated as code elements#text nodes (#17)convert() method for converter reuse__toString() now returns an empty string if input is emptyHow can I help you explore Laravel packages today?