PHP Markdown: History
This page shows the history for PHP Markdown Lib. You might also be interested in the classic version history.
PHP Markdown Lib 2.0.0 (26 Sep 2022)
Now requiring PHP version 7.4 or later.
Added type annotations to configuration properties of the parser. (Thanks to Tac Tacelosky.)
Fixing a TypeError in PHP 8 caused by invalid counter variable. (Thanks to Alexey Kopytko.)
Composer package now excludes development files. (Thanks to Cédric Anne.)
PHP Markdown Lib 1.9.1 — 23 Nov 2021
Now treating
<details>
and<summary>
as block level so they don’t get wrapped in<p>
. (Thanks to Thomas Hochstein for the fix.)Fix for unintended blank title attribute when adding supplementary attributes to a link in Markdown Extra. (Thanks to Richie Black for the fix.)
PHP Markdown Lib 1.9.0 — 1 Dec 2019
Added
fn_backlink_label
configuration variable to put some text in thearia-label
attribute. (Thanks to Sunny Walker for the implementation.)Occurances of “
^^
” infn_backlink_html
,fn_backlink_class
,fn_backlink_title
, andfn_backlink_label
will be replaced by the corresponding footnote number in the HTML output. Occurances of “%%
” will be replaced by a number for the reference (footnotes can have multiple references). (Thanks to Sunny Walker for the implementation.)Added configuration variable
omit_footnotes
. Whentrue
footnotes are not appended at the end of the generated HTML and thefootnotes_assembled
variable will contain the HTML for the footnote list, allowing footnotes to be moved somewhere else on the page. (Thanks to James K. for the implementation.)Note: when placing the content of
footnotes_assembled
on the page, consider adding the attributerole="doc-endnotes"
to the<div>
or<section>
that will enclose the list of footnotes so they are reachable to accessibility tools the same way they would be with the default HTML output.Fixed deprecation warnings from PHP about usage of curly braces to access characters in text strings. (Thanks to Remi Collet and Frans-Willem Post.)
PHP Markdown Lib 1.8.0 — 14 Jan 2018
Autoloading with Composer now uses PSR-4.
HTML output for Markdown Extra footnotes now include
role
attributes with values from WAI-ARIA to make them more accessible. (Thanks to Tobias Bengfort)In Markdown Extra, added the
hashtag_protection
configuration variable. When set totrue
it prevents ATX-style headers with no space after the initial hash from being interpreted as headers. This way your precious hashtags are preserved. (Thanks to Jaussoin Timothée for the implementation.)
PHP Markdown Lib 1.7.0 — 29 Oct 2016
Added a
hard_wrap
configuration variable to make all newline characters in the text become<br>
tags in the HTML output. By default, according to the standard Markdown syntax these newlines are ignored unless they a preceded by two spaces. Thanks to Jonathan Cohlmeyer for the implementation.Improved the parsing of list items to fix problematic cases that came to light with the addition of
hard_wrap
. This should have no effect on the output except span-level list items that ended with two spaces (and thus ended with a line break).Added a
code_span_content_func
configuration variable which takes a function that will convert the content of the code span to HTML. This can be useful to implement syntax highlighting. Although contrary to its code block equivalent, there is no syntax for specifying a language. Credits to styxit for the implementation.Fixed a Markdwon Extra issue where two-space-at-end-of-line hard breaks wouldn’t work inside of HTML block elements such as
<p markdown="1">
where the element expects only span-level content.In the parser code, switched to PHPDoc comment format. Thanks to Robbie Averill for the help.
PHP Markdown Lib 1.6.0 — 23 Dec 2015
Note: this version was incorrectly released as 1.5.1 on Dec 22, a number that contradicted the versioning policy.
For fenced code blocks in Markdown Extra, can now set a class name for the code block’s language before the special attribute block. Previously, this class name was only allowed in the absence of the special attribute block.
Added a
code_block_content_func
configuration variable which takes a function that will convert the content of the code block to HTML. This is most useful for syntax highlighting. For fenced code blocks in Markdown Extra, the function has access to the language class name (the one outside of the special attribute block). Credits to Mario Konrad for providing the implementation.The curled arrow character for the backlink in footnotes is now followed by a Unicode variant selector to prevent it from being displayed in emoji form on iOS.
Note that in older browsers the variant selector is often interpreted as a
separate character, making it visible after the arrow. So there is now a
also a fn_backlink_html
configuration variable that can be used to set
the link text to something else. Credits to Dana for providing the
implementation.
- Fixed an issue in MarkdownExtra where long header lines followed by a special attribute block would hit the backtrack limit an cause an empty string to be returned.
PHP Markdown Lib 1.5.0 — 1 Mar 2015
Added the ability start ordered lists with a number different from 1 and and have that reflected in the HTML output. This can be enabled with the
enhanced_ordered_lists
configuration variable for the Markdown parser; it is enabled by default for Markdown Extra. Credits to Matt Gorle for providing the implementation.Added the ability to insert custom HTML attributes with simple values everywhere an extra attribute block is allowed (links, images, headers). The value must be unquoted, cannot contains spaces and is limited to alphanumeric ASCII characters. Credits to Peter Droogmans for providing the implementation.
Added a
header_id_func
configuration variable which takes a function that can generate anid
attribute value from the header text. Credits to Evert Pot for providing the implementation.Added a
url_filter_func
configuration variable which takes a function that can rewrite any link or image URL to something different.
PHP Markdown Lib 1.4.1 — 4 May 2014
The HTML block parser will now treat
<figure>
as a block-level element (as it should) and no longer wrap it in<p>
or parse it’s content with the as Markdown syntax (although with Extra you can usemarkdown="1"
if you wish to use the Markdown syntax inside it).The content of
<style>
elements will now be left alone, its content won’t be interpreted as Markdown.Corrected an bug where some inline links with spaces in them would not work even when surounded with angle brackets:
[link](<s p a c e s>)
Fixed an issue where email addresses with quotes in them would not always have the quotes escaped in the link attribute, causing broken links (and invalid HTML).
Fixed the case were a link definition following a footnote definition would be swallowed by the footnote unless it was separated by a blank line.
PHP Markdown Lib 1.4.0 — 29 Nov 2013
Added support for the
tel:
URL scheme in automatic links.<tel:+1-111-111-1111>
It gets converted to this (note the
tel:
prefix becomes invisible):<a href="tel:+1-111-111-1111">+1-111-111-1111</a>
Added backtick fenced code blocks to MarkdownExtra, originally from Github-Flavored Markdown.
Added an interface called MarkdownInterface implemented by both the Markdown and MarkdownExtra parsers. You can use the interface if you want to create a mockup parser object for unit testing.
For those of you who cannot use class autoloading, you can now include
Michelf/Markdown.inc.php
orMichelf/MarkdownExtra.inc.php
(note the.inc.php
extension) to automatically include other files required by the parser.
PHP Markdown Lib 1.3 — April 11, 2013
This is the first release of PHP Markdown Lib. This package requires PHP version 5.3 or later and is designed to work with PSR-0 autoloading and, optionally with Composer. Here is a list of the changes since PHP Markdown Extra 1.2.6:
Plugin interface for Wordpress and other systems is no longer present in the Lib package. The classic package is still available if you need it: https://michelf.ca/projects/php-markdown/classic/
Added
public
andprotected
protection attributes, plus a section about what is “public API” and what isn’t in the Readme file.Changed HTML output for footnotes: now instead of adding
rel
andrev
attributes, footnotes links have the class namefootnote-ref
and backlinksfootnote-backref
.Fixed some regular expressions to make PCRE not shout warnings about POSIX collation classes (dependent on your version of PCRE).
Added optional class and id attributes to images and links using the same syntax as for headers:
[link](url){#id .class} ![img](url){#id .class}
It work too for reference-style links and images. In this case you need to put those attributes at the reference definition:
[link][linkref] or [linkref] ![img][linkref] [linkref]: url "optional title" {#id .class}
Fixed a PHP notice message triggered when some table column separator markers are missing on the separator line below column headers.
Fixed a small mistake that could cause the parser to retain an invalid state related to parsing links across multiple runs. This was never observed (that I know of), but it’s still worth fixing.