PHP Markdown Extra Readme.text 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  1. PHP Markdown Extra
  2. ==================
  3. Version 1.2.8 - 29 Nov 2013
  4. by Michel Fortin
  5. <http://michelf.ca/>
  6. based on Markdown by John Gruber
  7. <http://daringfireball.net/>
  8. Introduction
  9. ------------
  10. This is a special version of PHP Markdown with extra features. See
  11. <http://michelf.com/projects/php-markdown/extra/> for details.
  12. Markdown is a text-to-HTML conversion tool for web writers. Markdown
  13. allows you to write using an easy-to-read, easy-to-write plain text
  14. format, then convert it to structurally valid XHTML (or HTML).
  15. "Markdown" is two things: a plain text markup syntax, and a software
  16. tool, written in Perl, that converts the plain text markup to HTML.
  17. PHP Markdown is a port to PHP of the original Markdown program by
  18. John Gruber.
  19. PHP Markdown can work as a plug-in for WordPress, as a modifier for
  20. the Smarty templating engine, or as a replacement for Textile
  21. formatting in any software that supports Textile.
  22. Full documentation of Markdown's syntax is available on John's
  23. Markdown page: <http://daringfireball.net/projects/markdown/>
  24. Installation and Requirement
  25. ----------------------------
  26. PHP Markdown requires PHP version 4.0.5 or later.
  27. Before PHP 5.3.7, pcre.backtrack_limit defaults to 100 000, which is too small
  28. in many situations. You might need to set it to higher values. Later PHP
  29. releases defaults to 1 000 000, which is usually fine.
  30. ### WordPress ###
  31. PHP Markdown works with [WordPress][wp], version 1.2 or later.
  32. [wp]: http://wordpress.org/
  33. 1. To use PHP Markdown with WordPress, place the "markdown.php" file
  34. in the "plugins" folder. This folder is located inside
  35. "wp-content" at the root of your site:
  36. (site home)/wp-content/plugins/
  37. 2. Activate the plugin with the administrative interface of
  38. WordPress. In the "Plugins" section you will now find Markdown.
  39. To activate the plugin, click on the "Activate" button on the
  40. same line as Markdown. Your entries will now be formatted by
  41. PHP Markdown.
  42. 3. To post Markdown content, you'll first have to disable the
  43. "visual" editor in the User section of WordPress.
  44. You can configure PHP Markdown to not apply to the comments on your
  45. WordPress weblog. See the "Configuration" section below.
  46. It is not possible at this time to apply a different set of
  47. filters to different entries. All your entries will be formatted by
  48. PHP Markdown. This is a limitation of WordPress. If your old entries
  49. are written in HTML (as opposed to another formatting syntax, like
  50. Textile), they'll probably stay fine after installing Markdown.
  51. ### Replacing Textile in TextPattern ###
  52. [TextPattern][tp] use [Textile][tx] to format your text. You can
  53. replace Textile by Markdown in TextPattern without having to change
  54. any code by using the *Textile Compatibility Mode*. This may work
  55. with other software that expect Textile too.
  56. [tx]: http://www.textism.com/tools/textile/
  57. [tp]: http://www.textpattern.com/
  58. 1. Rename the "markdown.php" file to "classTextile.php". This will
  59. make PHP Markdown behave as if it was the actual Textile parser.
  60. 2. Replace the "classTextile.php" file TextPattern installed in your
  61. web directory. It can be found in the "lib" directory:
  62. (site home)/textpattern/lib/
  63. Contrary to Textile, Markdown does not convert quotes to curly ones
  64. and does not convert multiple hyphens (`--` and `---`) into en- and
  65. em-dashes. If you use PHP Markdown in Textile Compatibility Mode, you
  66. can solve this problem by installing the "smartypants.php" file from
  67. [PHP SmartyPants][psp] beside the "classTextile.php" file. The Textile
  68. Compatibility Mode function will use SmartyPants automatically without
  69. further modification.
  70. [psp]: http://michelf.ca/projects/php-smartypants/
  71. ### In Your Own Programs ###
  72. You can use PHP Markdown easily in your current PHP program. Simply
  73. include the file and then call the Markdown function on the text you
  74. want to convert:
  75. include_once "markdown.php";
  76. $my_html = Markdown($my_text);
  77. If you wish to use PHP Markdown with another text filter function
  78. built to parse HTML, you should filter the text *after* the Markdown
  79. function call. This is an example with [PHP SmartyPants][psp]:
  80. $my_html = SmartyPants(Markdown($my_text));
  81. ### With Smarty ###
  82. If your program use the [Smarty][sm] template engine, PHP Markdown
  83. can now be used as a modifier for your templates. Rename "markdown.php"
  84. to "modifier.markdown.php" and put it in your smarty plugins folder.
  85. [sm]: http://smarty.php.net/
  86. If you are using MovableType 3.1 or later, the Smarty plugin folder is
  87. located at `(MT CGI root)/php/extlib/smarty/plugins`. This will allow
  88. Markdown to work on dynamic pages.
  89. ### Updating Markdown in Other Programs ###
  90. Many web applications now ship with PHP Markdown, or have plugins to
  91. perform the conversion to HTML. You can update PHP Markdown -- or
  92. replace it with PHP Markdown Extra -- in many of these programs by
  93. swapping the old "markdown.php" file for the new one.
  94. Here is a short non-exhaustive list of some programs and where they
  95. hide the "markdown.php" file.
  96. | Program | Path to Markdown
  97. | ------- | ----------------
  98. | [Pivot][] | `(site home)/pivot/includes/markdown/`
  99. If you're unsure if you can do this with your application, ask the
  100. developer, or wait for the developer to update his application or
  101. plugin with the new version of PHP Markdown.
  102. [Pivot]: http://pivotlog.net/
  103. Configuration
  104. -------------
  105. By default, PHP Markdown produces XHTML output for tags with empty
  106. elements. E.g.:
  107. <br />
  108. Markdown can be configured to produce HTML-style tags; e.g.:
  109. <br>
  110. To do this, you must edit the "MARKDOWN_EMPTY_ELEMENT_SUFFIX"
  111. definition below the "Global default settings" header at the start of
  112. the "markdown.php" file.
  113. ### WordPress-Specific Settings ###
  114. By default, the Markdown plugin applies to both posts and comments on
  115. your WordPress weblog. To deactivate one or the other, edit the
  116. `MARKDOWN_WP_POSTS` or `MARKDOWN_WP_COMMENTS` definitions under the
  117. "WordPress settings" header at the start of the "markdown.php" file.
  118. Bugs
  119. ----
  120. To file bug reports please send email to:
  121. <michel.fortin@michelf.ca>
  122. Please include with your report: (1) the example input; (2) the output you
  123. expected; (3) the output PHP Markdown actually produced.
  124. If you have a problem where Markdown gives you an empty result, first check
  125. that the backtrack limit is not too low by running `php --info | grep pcre`.
  126. See Installation and Requirement above for details.
  127. Version History
  128. ---------------
  129. Extra 1.2.8:
  130. * Added backtick fenced code blocks, originally from Github-flavored Markdown.
  131. 1.0.2
  132. * Added support for the `tel:` URL scheme in automatic links.
  133. <tel:+1-111-111-1111>
  134. It gets converted to this (note the `tel:` prefix becomes invisible):
  135. <a href="tel:+1-111-111-1111">+1-111-111-1111</a>
  136. Extra 1.2.7 (11 Apr 2013):
  137. * Added optional class and id attributes to images and links using the same
  138. syntax as for headers:
  139. [link](url){#id .class}
  140. ![img](url){#id .class}
  141. It work too for reference-style links and images. In this case you need
  142. to put those attributes at the reference definition:
  143. [link][linkref] or [linkref]
  144. ![img][linkref]
  145. [linkref]: url "optional title" {#id .class}
  146. * Fixed a PHP notice message triggered when some table column separator
  147. markers are missing on the separator line below column headers.
  148. 1.0.1q (11 Apr 2013):
  149. * Fixed a small mistake that could cause the parser to retain an invalid
  150. state related to parsing links across multiple runs. This was never
  151. observed (that I know of), but it's still worth fixing.
  152. Extra 1.2.6 (13 Jan 2013):
  153. * Headers can now have a class attribute. You can add a class inside the
  154. extra attribute block which can optionally be put after a header:
  155. ### Header ### {#id .class1 .class2}
  156. Spaces between components in the brace is optional.
  157. * Fenced code blocks can also have a class and an id attribute. If you only
  158. need to apply a class (typically to indicate the language of a code
  159. snippet), you can write it like this:
  160. ~~~ html
  161. <b>bold</b>
  162. ~~~
  163. or like this:
  164. ~~~ .html
  165. <b>bold</b>
  166. ~~~
  167. There is a new configuration option `MARKDOWN_CODE_CLASS_PREFIX` you can
  168. use if you need to append a prefix to the class name.
  169. You might also opt to use an extra attribute block just like for headers:
  170. ~~~ {.html #id .codeclass}
  171. <b>bold</b>
  172. ~~~
  173. Note that class names added this way are not affected by the
  174. MARKDOWN_CODE_CLASS_PREFIX.
  175. A code block creates a `pre` HTML element containing a `code` element.
  176. The `code` HTML element is the one that receives the attribute. If for
  177. some reason you need attributes to be applied to the enclosing `pre`
  178. element instead, you can set the MARKDOWN_CODE_ATTR_ON_PRE configuration
  179. variable to true.
  180. * Fixed an issue were consecutive fenced code blocks containing HTML-like
  181. code would confuse the parser.
  182. * Multiple references to the same footnote are now allowed.
  183. * Fixed an issue where no_markup mode was ineffective.
  184. 1.0.1p (13 Jan 2013):
  185. * Fixed an issue where some XML-style empty tags (such as `<br/>`) were not
  186. recognized correctly as such when inserted into Markdown-formatted text.
  187. * The following HTML 5 elements are treated as block elements when at the
  188. root of an HTML block: `article`, `section`, `nav`, `aside`, `hgroup`,
  189. `header`, `footer`, and `figure`. `svg` too.
  190. 1.0.1o (8 Jan 2012):
  191. * Silenced a new warning introduced around PHP 5.3 complaining about
  192. POSIX characters classes not being implemented. PHP Markdown does not
  193. use POSIX character classes, but it nevertheless trigged that warning.
  194. Extra 1.2.5 (8 Jan 2012):
  195. * Fixed an issue preventing fenced code blocks indented inside lists items
  196. and elsewhere from being interpreted correctly.
  197. * Fixed an issue where HTML tags inside fenced code blocks were sometime
  198. not encoded with entities.
  199. 1.0.1n (10 Oct 2009):
  200. * Enabled reference-style shortcut links. Now you can write reference-style
  201. links with less brakets:
  202. This is [my website].
  203. [my website]: http://example.com/
  204. This was added in the 1.0.2 betas, but commented out in the 1.0.1 branch,
  205. waiting for the feature to be officialized. [But half of the other Markdown
  206. implementations are supporting this syntax][half], so it makes sense for
  207. compatibility's sake to allow it in PHP Markdown too.
  208. [half]: http://babelmark.bobtfish.net/?markdown=This+is+%5Bmy+website%5D.%0D%0A%09%09%0D%0A%5Bmy+website%5D%3A+http%3A%2F%2Fexample.com%2F%0D%0A&src=1&dest=2
  209. * Now accepting many valid email addresses in autolinks that were
  210. previously rejected, such as:
  211. <abc+mailbox/department=shipping@example.com>
  212. <!#$%&'*+-/=?^_`.{|}~@example.com>
  213. <"abc@def"@example.com>
  214. <"Fred Bloggs"@example.com>
  215. <jsmith@[192.0.2.1]>
  216. * Now accepting spaces in URLs for inline and reference-style links. Such
  217. URLs need to be surrounded by angle brakets. For instance:
  218. [link text](<http://url/with space> "optional title")
  219. [link text][ref]
  220. [ref]: <http://url/with space> "optional title"
  221. There is still a quirk which may prevent this from working correctly with
  222. relative URLs in inline-style links however.
  223. * Fix for adjacent list of different kind where the second list could
  224. end as a sublist of the first when not separated by an empty line.
  225. * Fixed a bug where inline-style links wouldn't be recognized when the link
  226. definition contains a line break between the url and the title.
  227. * Fixed a bug where tags where the name contains an underscore aren't parsed
  228. correctly.
  229. * Fixed some corner-cases mixing underscore-ephasis and asterisk-emphasis.
  230. Extra 1.2.4 (10 Oct 2009):
  231. * Fixed a problem where unterminated tags in indented code blocks could
  232. prevent proper escaping of characaters in the code block.
  233. Extra 1.2.3 (31 Dec 2008):
  234. * In WordPress pages featuring more than one post, footnote id prefixes are
  235. now automatically applied with the current post ID to avoid clashes
  236. between footnotes belonging to different posts.
  237. * Fix for a bug introduced in Extra 1.2 where block-level HTML tags where
  238. not detected correctly, thus the addition of erroneous `<p>` tags and
  239. interpretation of their content as Markdown-formatted instead of
  240. HTML-formatted.
  241. Extra 1.2.2 (21 Jun 2008):
  242. * Fixed a problem where abbreviation definitions, footnote
  243. definitions and link references were stripped inside
  244. fenced code blocks.
  245. * Fixed a bug where characters such as `"` in abbreviation
  246. definitions weren't properly encoded to HTML entities.
  247. * Fixed a bug where double quotes `"` were not correctly encoded
  248. as HTML entities when used inside a footnote reference id.
  249. 1.0.1m (21 Jun 2008):
  250. * Lists can now have empty items.
  251. * Rewrote the emphasis and strong emphasis parser to fix some issues
  252. with odly placed and overlong markers.
  253. Extra 1.2.1 (27 May 2008):
  254. * Fixed a problem where Markdown headers and horizontal rules were
  255. transformed into their HTML equivalent inside fenced code blocks.
  256. Extra 1.2 (11 May 2008):
  257. * Added fenced code block syntax which don't require indentation
  258. and can start and end with blank lines. A fenced code block
  259. starts with a line of consecutive tilde (~) and ends on the
  260. next line with the same number of consecutive tilde. Here's an
  261. example:
  262. ~~~~~~~~~~~~
  263. Hello World!
  264. ~~~~~~~~~~~~
  265. * Rewrote parts of the HTML block parser to better accomodate
  266. fenced code blocks.
  267. * Footnotes may now be referenced from within another footnote.
  268. * Added programatically-settable parser property `predef_attr` for
  269. predefined attribute definitions.
  270. * Fixed an issue where an indented code block preceded by a blank
  271. line containing some other whitespace would confuse the HTML
  272. block parser into creating an HTML block when it should have
  273. been code.
  274. 1.0.1l (11 May 2008):
  275. * Now removing the UTF-8 BOM at the start of a document, if present.
  276. * Now accepting capitalized URI schemes (such as HTTP:) in automatic
  277. links, such as `<HTTP://EXAMPLE.COM/>`.
  278. * Fixed a problem where `<hr@example.com>` was seen as a horizontal
  279. rule instead of an automatic link.
  280. * Fixed an issue where some characters in Markdown-generated HTML
  281. attributes weren't properly escaped with entities.
  282. * Fix for code blocks as first element of a list item. Previously,
  283. this didn't create any code block for item 2:
  284. * Item 1 (regular paragraph)
  285. * Item 2 (code block)
  286. * A code block starting on the second line of a document wasn't seen
  287. as a code block. This has been fixed.
  288. * Added programatically-settable parser properties `predef_urls` and
  289. `predef_titles` for predefined URLs and titles for reference-style
  290. links. To use this, your PHP code must call the parser this way:
  291. $parser = new Markdwon_Parser;
  292. $parser->predef_urls = array('linkref' => 'http://example.com');
  293. $html = $parser->transform($text);
  294. You can then use the URL as a normal link reference:
  295. [my link][linkref]
  296. [my link][linkRef]
  297. Reference names in the parser properties *must* be lowercase.
  298. Reference names in the Markdown source may have any case.
  299. * Added `setup` and `teardown` methods which can be used by subclassers
  300. as hook points to arrange the state of some parser variables before and
  301. after parsing.
  302. Extra 1.1.7 (26 Sep 2007):
  303. 1.0.1k (26 Sep 2007):
  304. * Fixed a problem introduced in 1.0.1i where three or more identical
  305. uppercase letters, as well as a few other symbols, would trigger
  306. a horizontal line.
  307. Extra 1.1.6 (4 Sep 2007):
  308. 1.0.1j (4 Sep 2007):
  309. * Fixed a problem introduced in 1.0.1i where the closing `code` and
  310. `pre` tags at the end of a code block were appearing in the wrong
  311. order.
  312. * Overriding configuration settings by defining constants from an
  313. external before markdown.php is included is now possible without
  314. producing a PHP warning.
  315. Extra 1.1.5 (31 Aug 2007):
  316. 1.0.1i (31 Aug 2007):
  317. * Fixed a problem where an escaped backslash before a code span
  318. would prevent the code span from being created. This should now
  319. work as expected:
  320. Litteral backslash: \\`code span`
  321. * Overall speed improvements, especially with long documents.
  322. Extra 1.1.4 (3 Aug 2007):
  323. 1.0.1h (3 Aug 2007):
  324. * Added two properties (`no_markup` and `no_entities`) to the parser
  325. allowing HTML tags and entities to be disabled.
  326. * Fix for a problem introduced in 1.0.1g where posting comments in
  327. WordPress would trigger PHP warnings and cause some markup to be
  328. incorrectly filtered by the kses filter in WordPress.
  329. Extra 1.1.3 (3 Jul 2007):
  330. * Fixed a performance problem when parsing some invalid HTML as an HTML
  331. block which was resulting in too much recusion and a segmentation fault
  332. for long documents.
  333. * The markdown="" attribute now accepts unquoted values.
  334. * Fixed an issue where underscore-emphasis didn't work when applied on the
  335. first or the last word of an element having the markdown="1" or
  336. markdown="span" attribute set unless there was some surrounding whitespace.
  337. This didn't work:
  338. <p markdown="1">_Hello_ _world_</p>
  339. Now it does produce emphasis as expected.
  340. * Fixed an issue preventing footnotes from working when the parser's
  341. footnote id prefix variable (fn_id_prefix) is not empty.
  342. * Fixed a performance problem where the regular expression for strong
  343. emphasis introduced in version 1.1 could sometime be long to process,
  344. give slightly wrong results, and in some circumstances could remove
  345. entirely the content for a whole paragraph.
  346. * Fixed an issue were abbreviations tags could be incorrectly added
  347. inside URLs and title of links.
  348. * Placing footnote markers inside a link, resulting in two nested links, is
  349. no longer allowed.
  350. 1.0.1g (3 Jul 2007):
  351. * Fix for PHP 5 compiled without the mbstring module. Previous fix to
  352. calculate the length of UTF-8 strings in `detab` when `mb_strlen` is
  353. not available was only working with PHP 4.
  354. * Fixed a problem with WordPress 2.x where full-content posts in RSS feeds
  355. were not processed correctly by Markdown.
  356. * Now supports URLs containing literal parentheses for inline links
  357. and images, such as:
  358. [WIMP](http://en.wikipedia.org/wiki/WIMP_(computing))
  359. Such parentheses may be arbitrarily nested, but must be
  360. balanced. Unbalenced parentheses are allowed however when the URL
  361. when escaped or when the URL is enclosed in angle brakets `<>`.
  362. * Fixed a performance problem where the regular expression for strong
  363. emphasis introduced in version 1.0.1d could sometime be long to process,
  364. give slightly wrong results, and in some circumstances could remove
  365. entirely the content for a whole paragraph.
  366. * Some change in version 1.0.1d made possible the incorrect nesting of
  367. anchors within each other. This is now fixed.
  368. * Fixed a rare issue where certain MD5 hashes in the content could
  369. be changed to their corresponding text. For instance, this:
  370. The MD5 value for "+" is "26b17225b626fb9238849fd60eabdf60".
  371. was incorrectly changed to this in previous versions of PHP Markdown:
  372. <p>The MD5 value for "+" is "+".</p>
  373. * Now convert escaped characters to their numeric character
  374. references equivalent.
  375. This fix an integration issue with SmartyPants and backslash escapes.
  376. Since Markdown and SmartyPants have some escapable characters in common,
  377. it was sometime necessary to escape them twice. Previously, two
  378. backslashes were sometime required to prevent Markdown from "eating" the
  379. backslash before SmartyPants sees it:
  380. Here are two hyphens: \\--
  381. Now, only one backslash will do:
  382. Here are two hyphens: \--
  383. Extra 1.1.2 (7 Feb 2007)
  384. * Fixed an issue where headers preceded too closely by a paragraph
  385. (with no blank line separating them) where put inside the paragraph.
  386. * Added the missing TextileRestricted method that was added to regular
  387. PHP Markdown since 1.0.1d but which I forgot to add to Extra.
  388. 1.0.1f (7 Feb 2007):
  389. * Fixed an issue with WordPress where manually-entered excerpts, but
  390. not the auto-generated ones, would contain nested paragraphs.
  391. * Fixed an issue introduced in 1.0.1d where headers and blockquotes
  392. preceded too closely by a paragraph (not separated by a blank line)
  393. where incorrectly put inside the paragraph.
  394. * Fixed an issue introduced in 1.0.1d in the tokenizeHTML method where
  395. two consecutive code spans would be merged into one when together they
  396. form a valid tag in a multiline paragraph.
  397. * Fixed an long-prevailing issue where blank lines in code blocks would
  398. be doubled when the code block is in a list item.
  399. This was due to the list processing functions relying on artificially
  400. doubled blank lines to correctly determine when list items should
  401. contain block-level content. The list item processing model was thus
  402. changed to avoid the need for double blank lines.
  403. * Fixed an issue with `<% asp-style %>` instructions used as inline
  404. content where the opening `<` was encoded as `&lt;`.
  405. * Fixed a parse error occuring when PHP is configured to accept
  406. ASP-style delimiters as boundaries for PHP scripts.
  407. * Fixed a bug introduced in 1.0.1d where underscores in automatic links
  408. got swapped with emphasis tags.
  409. Extra 1.1.1 (28 Dec 2006)
  410. * Fixed a problem where whitespace at the end of the line of an atx-style
  411. header would cause tailing `#` to appear as part of the header's content.
  412. This was caused by a small error in the regex that handles the definition
  413. for the id attribute in PHP Markdown Extra.
  414. * Fixed a problem where empty abbreviations definitions would eat the
  415. following line as its definition.
  416. * Fixed an issue with calling the Markdown parser repetitivly with text
  417. containing footnotes. The footnote hashes were not reinitialized properly.
  418. 1.0.1e (28 Dec 2006)
  419. * Added support for internationalized domain names for email addresses in
  420. automatic link. Improved the speed at which email addresses are converted
  421. to entities. Thanks to Milian Wolff for his optimisations.
  422. * Made deterministic the conversion to entities of email addresses in
  423. automatic links. This means that a given email address will always be
  424. encoded the same way.
  425. * PHP Markdown will now use its own function to calculate the length of an
  426. UTF-8 string in `detab` when `mb_strlen` is not available instead of
  427. giving a fatal error.
  428. Extra 1.1 (1 Dec 2006)
  429. * Added a syntax for footnotes.
  430. * Added an experimental syntax to define abbreviations.
  431. 1.0.1d (1 Dec 2006)
  432. * Fixed a bug where inline images always had an empty title attribute. The
  433. title attribute is now present only when explicitly defined.
  434. * Link references definitions can now have an empty title, previously if the
  435. title was defined but left empty the link definition was ignored. This can
  436. be useful if you want an empty title attribute in images to hide the
  437. tooltip in Internet Explorer.
  438. * Made `detab` aware of UTF-8 characters. UTF-8 multi-byte sequences are now
  439. correctly mapped to one character instead of the number of bytes.
  440. * Fixed a small bug with WordPress where WordPress' default filter `wpautop`
  441. was not properly deactivated on comment text, resulting in hard line breaks
  442. where Markdown do not prescribes them.
  443. * Added a `TextileRestrited` method to the textile compatibility mode. There
  444. is no restriction however, as Markdown does not have a restricted mode at
  445. this point. This should make PHP Markdown work again in the latest
  446. versions of TextPattern.
  447. * Converted PHP Markdown to a object-oriented design.
  448. * Changed span and block gamut methods so that they loop over a
  449. customizable list of methods. This makes subclassing the parser a more
  450. interesting option for creating syntax extensions.
  451. * Also added a "document" gamut loop which can be used to hook document-level
  452. methods (like for striping link definitions).
  453. * Changed all methods which were inserting HTML code so that they now return
  454. a hashed representation of the code. New methods `hashSpan` and `hashBlock`
  455. are used to hash respectivly span- and block-level generated content. This
  456. has a couple of significant effects:
  457. 1. It prevents invalid nesting of Markdown-generated elements which
  458. could occur occuring with constructs like `*something [link*][1]`.
  459. 2. It prevents problems occuring with deeply nested lists on which
  460. paragraphs were ill-formed.
  461. 3. It removes the need to call `hashHTMLBlocks` twice during the the
  462. block gamut.
  463. Hashes are turned back to HTML prior output.
  464. * Made the block-level HTML parser smarter using a specially-crafted regular
  465. expression capable of handling nested tags.
  466. * Solved backtick issues in tag attributes by rewriting the HTML tokenizer to
  467. be aware of code spans. All these lines should work correctly now:
  468. <span attr='`ticks`'>bar</span>
  469. <span attr='``double ticks``'>bar</span>
  470. `<test a="` content of attribute `">`
  471. * Changed the parsing of HTML comments to match simply from `<!--` to `-->`
  472. instead using of the more complicated SGML-style rule with paired `--`.
  473. This is how most browsers parse comments and how XML defines them too.
  474. * `<address>` has been added to the list of block-level elements and is now
  475. treated as an HTML block instead of being wrapped within paragraph tags.
  476. * Now only trim trailing newlines from code blocks, instead of trimming
  477. all trailing whitespace characters.
  478. * Fixed bug where this:
  479. [text](http://m.com "title" )
  480. wasn't working as expected, because the parser wasn't allowing for spaces
  481. before the closing paren.
  482. * Filthy hack to support markdown='1' in div tags.
  483. * _DoAutoLinks() now supports the 'dict://' URL scheme.
  484. * PHP- and ASP-style processor instructions are now protected as
  485. raw HTML blocks.
  486. <? ... ?>
  487. <% ... %>
  488. * Fix for escaped backticks still triggering code spans:
  489. There are two raw backticks here: \` and here: \`, not a code span
  490. Extra 1.0 - 5 September 2005
  491. * Added support for setting the id attributes for headers like this:
  492. Header 1 {#header1}
  493. ========
  494. ## Header 2 ## {#header2}
  495. This only work only for headers for now.
  496. * Tables will now work correctly as the first element of a definition
  497. list. For example, this input:
  498. Term
  499. : Header | Header
  500. ------- | -------
  501. Cell | Cell
  502. used to produce no definition list and a table where the first
  503. header was named ": Header". This is now fixed.
  504. * Fix for a problem where a paragraph following a table was not
  505. placed between `<p>` tags.
  506. Extra 1.0b4 - 1 August 2005
  507. * Fixed some issues where whitespace around HTML blocks were trigging
  508. empty paragraph tags.
  509. * Fixed an HTML block parsing issue that would cause a block element
  510. following a code span or block with unmatched opening bracket to be
  511. placed inside a paragraph.
  512. * Removed some PHP notices that could appear when parsing definition
  513. lists and tables with PHP notice reporting flag set.
  514. Extra 1.0b3 - 29 July 2005
  515. * Definition lists now require a blank line before each term. Solves
  516. an ambiguity where the last line of lazy-indented definitions could
  517. be mistaken by PHP Markdown as a new term in the list.
  518. * Definition lists now support multiple terms per definition.
  519. * Some special tags were replaced in the output by their md5 hash
  520. key. Things such as this now work as expected:
  521. ## Header <?php echo $number ?> ##
  522. Extra 1.0b2 - 26 July 2005
  523. * Definition lists can now take two or more definitions for one term.
  524. This should have been the case before, but a bug prevented this
  525. from working right.
  526. * Fixed a problem where single column table with a pipe only at the
  527. end where not parsed as table. Here is such a table:
  528. | header
  529. | ------
  530. | cell
  531. * Fixed problems with empty cells in the first column of a table with
  532. no leading pipe, like this one:
  533. header | header
  534. ------ | ------
  535. | cell
  536. * Code spans containing pipes did not within a table. This is now
  537. fixed by parsing code spans before splitting rows into cells.
  538. * Added the pipe character to the backlash escape character lists.
  539. Extra 1.0b1 (25 Jun 2005)
  540. * First public release of PHP Markdown Extra.
  541. Copyright and License
  542. ---------------------
  543. PHP Markdown & Extra
  544. Copyright (c) 2004-2013 Michel Fortin
  545. <http://michelf.ca/>
  546. All rights reserved.
  547. Based on Markdown
  548. Copyright (c) 2003-2005 John Gruber
  549. <http://daringfireball.net/>
  550. All rights reserved.
  551. Redistribution and use in source and binary forms, with or without
  552. modification, are permitted provided that the following conditions are
  553. met:
  554. * Redistributions of source code must retain the above copyright
  555. notice, this list of conditions and the following disclaimer.
  556. * Redistributions in binary form must reproduce the above copyright
  557. notice, this list of conditions and the following disclaimer in the
  558. documentation and/or other materials provided with the
  559. distribution.
  560. * Neither the name "Markdown" nor the names of its contributors may
  561. be used to endorse or promote products derived from this software
  562. without specific prior written permission.
  563. This software is provided by the copyright holders and contributors "as
  564. is" and any express or implied warranties, including, but not limited
  565. to, the implied warranties of merchantability and fitness for a
  566. particular purpose are disclaimed. In no event shall the copyright owner
  567. or contributors be liable for any direct, indirect, incidental, special,
  568. exemplary, or consequential damages (including, but not limited to,
  569. procurement of substitute goods or services; loss of use, data, or
  570. profits; or business interruption) however caused and on any theory of
  571. liability, whether in contract, strict liability, or tort (including
  572. negligence or otherwise) arising in any way out of the use of this
  573. software, even if advised of the possibility of such damage.