aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/michelf/php-markdown/Readme.md
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/michelf/php-markdown/Readme.md')
-rw-r--r--vendor/michelf/php-markdown/Readme.md193
1 files changed, 109 insertions, 84 deletions
diff --git a/vendor/michelf/php-markdown/Readme.md b/vendor/michelf/php-markdown/Readme.md
index 044407106..c05cd93d4 100644
--- a/vendor/michelf/php-markdown/Readme.md
+++ b/vendor/michelf/php-markdown/Readme.md
@@ -1,7 +1,7 @@
PHP Markdown
============
-PHP Markdown Lib 1.7.0 - 29 Oct 2016
+PHP Markdown Lib 1.8.0 - 14 Jan 2018
by Michel Fortin
<https://michelf.ca/>
@@ -13,16 +13,16 @@ based on Markdown by John Gruber
Introduction
------------
-This is a library package that includes the PHP Markdown parser and its
+This is a library package that includes the PHP Markdown parser and its
sibling PHP Markdown Extra with additional features.
Markdown is a text-to-HTML conversion tool for web writers. Markdown
allows you to write using an easy-to-read, easy-to-write plain text
format, then convert it to structurally valid XHTML (or HTML).
-"Markdown" is actually two things: a plain text markup syntax, and a
-software tool, originally written in Perl, that converts the plain text
-markup to HTML. PHP Markdown is a port to PHP of the original Markdown
+"Markdown" is actually two things: a plain text markup syntax, and a
+software tool, originally written in Perl, that converts the plain text
+markup to HTML. PHP Markdown is a port to PHP of the original Markdown
program by John Gruber.
* [Full documentation of the Markdown syntax](<https://daringfireball.net/projects/markdown/>)
@@ -37,68 +37,77 @@ Requirement
This library package requires PHP 5.3 or later.
Note: The older plugin/library hybrid package for PHP Markdown and
-PHP Markdown Extra is still maintained and will work with PHP 4.0.5 and later.
+PHP Markdown Extra is no longer maintained but will work with PHP 4.0.5 and
+later.
Before PHP 5.3.7, pcre.backtrack_limit defaults to 100 000, which is too small
-in many situations. You might need to set it to higher values. Later PHP
+in many situations. You might need to set it to higher values. Later PHP
releases defaults to 1 000 000, which is usually fine.
Usage
-----
-This library package is meant to be used with class autoloading. For autoloading
-to work, your project needs have setup a PSR-0-compatible autoloader. See the
-included Readme.php file for a minimal autoloader setup. (If you cannot use
-autoloading, see below.)
+To use this library with Composer, first install it with:
-With class autoloading in place, putting the 'Michelf' folder in your
-include path should be enough for this to work:
+ $ composer require michelf/php-markdown
- use \Michelf\Markdown;
+Then include Composer's generated vendor/autoload.php to [enable autoloading]:
+
+ require 'vendor/autoload.php';
+
+Without Composer, for autoloading to work, your project needs an autoloader
+compatible with PSR-4 or PSR-0. See the included Readme.php file for a minimal
+autoloader setup. (If you cannot use autoloading, see below.)
+
+With class autoloading in place:
+
+ use Michelf\Markdown;
$my_html = Markdown::defaultTransform($my_text);
Markdown Extra syntax is also available the same way:
- use \Michelf\MarkdownExtra;
+ use Michelf\MarkdownExtra;
$my_html = MarkdownExtra::defaultTransform($my_text);
-If you wish to use PHP Markdown with another text filter function
+If you wish to use PHP Markdown with another text filter function
built to parse HTML, you should filter the text *after* the `transform`
-function call. This is an example with [PHP SmartyPants][psp]:
+function call. This is an example with [PHP SmartyPants]:
- use \Michelf\Markdown, \Michelf\SmartyPants;
+ use Michelf\Markdown, Michelf\SmartyPants;
$my_html = Markdown::defaultTransform($my_text);
$my_html = SmartyPants::defaultTransform($my_html);
-All these examples are using the static `defaultTransform` static function
-found inside the parser class. If you want to customize the parser
-configuration, you can also instantiate it directly and change some
+All these examples are using the static `defaultTransform` static function
+found inside the parser class. If you want to customize the parser
+configuration, you can also instantiate it directly and change some
configuration variables:
- use \Michelf\MarkdownExtra;
+ use Michelf\MarkdownExtra;
$parser = new MarkdownExtra;
$parser->fn_id_prefix = "post22-";
$my_html = $parser->transform($my_text);
To learn more, see the full list of [configuration variables].
+ [enable autoloading]: https://getcomposer.org/doc/01-basic-usage.md#autoloading
+ [PHP SmartyPants]: https://michelf.ca/projects/php-smartypants/
[configuration variables]: https://michelf.ca/projects/php-markdown/configuration/
### Usage without an autoloader
-If you cannot use class autoloading, you can still use `include` or `require`
-to access the parser. To load the `\Michelf\Markdown` parser, do it this way:
+If you cannot use class autoloading, you can still use `include` or `require`
+to access the parser. To load the `Michelf\Markdown` parser, do it this way:
require_once 'Michelf/Markdown.inc.php';
-Or, if you need the `\Michelf\MarkdownExtra` parser:
+Or, if you need the `Michelf\MarkdownExtra` parser:
require_once 'Michelf/MarkdownExtra.inc.php';
While the plain `.php` files depend on autoloading to work correctly, using the
-`.inc.php` files instead will eagerly load the dependencies that would be
+`.inc.php` files instead will eagerly load the dependencies that would be
loaded on demand if you were using autoloading.
@@ -113,19 +122,19 @@ functions and their configuration variables. The public API is stable for
a given major version number. It might get additions when the minor version
number increments.
-**Protected members are not considered public API.** This is unconventional
-and deserves an explanation. Incrementing the major version number every time
+**Protected members are not considered public API.** This is unconventional
+and deserves an explanation. Incrementing the major version number every time
the underlying implementation of something changes is going to give
nonessential version numbers for the vast majority of people who just use the
parser. Protected members are meant to create parser subclasses that behave in
-different ways. Very few people create parser subclasses. I don't want to
-discourage it by making everything private, but at the same time I can't
+different ways. Very few people create parser subclasses. I don't want to
+discourage it by making everything private, but at the same time I can't
guarantee any stable hook between versions if you use protected members.
-**Syntax changes** will increment the minor number for new features, and the
-patch number for small corrections. A *new feature* is something that needs a
+**Syntax changes** will increment the minor number for new features, and the
+patch number for small corrections. A *new feature* is something that needs a
change in the syntax documentation. Note that since PHP Markdown Lib includes
-two parsers, a syntax change for either of them will increment the minor
+two parsers, a syntax change for either of them will increment the minor
number. Also note that there is nothing perfectly backward-compatible with the
Markdown syntax: all inputs are always valid, so new features always replace
something that was previously legal, although generally nonsensical to do.
@@ -140,7 +149,7 @@ To file bug reports please send email to:
Please include with your report: (1) the example input; (2) the output you
expected; (3) the output PHP Markdown actually produced.
-If you have a problem where Markdown gives you an empty result, first check
+If you have a problem where Markdown gives you an empty result, first check
that the backtrack limit is not too low by running `php --info | grep pcre`.
See Installation and Requirement above for details.
@@ -149,12 +158,12 @@ Development and Testing
-----------------------
Pull requests for fixing bugs are welcome. Proposed new features are
-going to be meticulously reviewed -- taking into account backward compatibility,
+going to be meticulously reviewed -- taking into account backward compatibility,
potential side effects, and future extensibility -- before deciding on
acceptance or rejection.
-If you make a pull request that includes changes to the parser please add
-tests for what is being changed to [MDTest][] and make a pull request there
+If you make a pull request that includes changes to the parser please add
+tests for what is being changed to [MDTest][] and make a pull request there
too.
[MDTest]: https://github.com/michelf/mdtest/
@@ -163,7 +172,7 @@ too.
Donations
---------
-If you wish to make a donation that will help me devote more time to
+If you wish to make a donation that will help me devote more time to
PHP Markdown, please visit [michelf.ca/donate] or send Bitcoin to
[1HiuX34czvVPPdhXbUAsAu7pZcesniDCGH].
@@ -174,56 +183,72 @@ PHP Markdown, please visit [michelf.ca/donate] or send Bitcoin to
Version History
---------------
+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](https://www.w3.org/TR/dpub-aria/) to
+ make them more accessible.
+ (Thanks to Tobias Bengfort)
+
+* In Markdown Extra, added the `hashtag_protection` configuration variable.
+ When set to `true` 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
+* 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
+* 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
+* 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.
+ 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">`
+* Fixed a Markdown 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
+* 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)
+PHP Markdown Lib 1.6.0 (23 Dec 2015)
-Note: this version was incorrectly released as 1.5.1 on Dec 22, a number
+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
+* 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
+* 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
+ 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
@@ -235,13 +260,13 @@ 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
+ 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
+* 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
+ The value must be unquoted, cannot contains spaces and is limited to
alphanumeric ASCII characters.
Credits to Peter Droogmans for providing the implementation.
@@ -256,7 +281,7 @@ PHP Markdown Lib 1.5.0 (1 Mar 2015)
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
+ (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 use `markdown="1"`
if you wish to use the Markdown syntax inside it).
@@ -265,7 +290,7 @@ PHP Markdown Lib 1.4.1 (4 May 2014)
* 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
@@ -281,9 +306,9 @@ 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
@@ -294,16 +319,16 @@ PHP Markdown Lib 1.4.0 (29 Nov 2013)
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` or `Michelf/MarkdownExtra.inc.php` (note
+ include `Michelf/Markdown.inc.php` or `Michelf/MarkdownExtra.inc.php` (note
the `.inc.php` extension) to automatically include other files required
by the parser.
PHP Markdown Lib 1.3 (11 Apr 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
+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
@@ -323,22 +348,22 @@ PHP Markdown Extra 1.2.6:
* Added optional class and id attributes to images and links using the same
syntax as for headers:
- [link](url){#id .class}
+ [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]
+ [link][linkref] or [linkref]
![img][linkref]
-
+
[linkref]: url "optional title" {#id .class}
-* Fixed a PHP notice message triggered when some table column separator
+* 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
+ state related to parsing links across multiple runs. This was never
observed (that I know of), but it's still worth fixing.
@@ -351,20 +376,20 @@ Copyright (c) 2004-2016 Michel Fortin
All rights reserved.
Based on Markdown
-Copyright (c) 2003-2005 John Gruber
-<https://daringfireball.net/>
+Copyright (c) 2003-2005 John Gruber
+<https://daringfireball.net/>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
-* Redistributions of source code must retain the above copyright
+* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the
+ documentation and/or other materials provided with the
distribution.
* Neither the name "Markdown" nor the names of its contributors may