From 7123d05395ed3b79f9400cdf2a7cd9846e2bd078 Mon Sep 17 00:00:00 2001 From: Michel Fortin Date: Sat, 10 Oct 2009 07:41:47 -0400 Subject: [PATCH 1/2] Enabled reference-style shortcuts. --- PHP Markdown Readme.text | 14 ++++++++++++++ markdown.php | 16 ++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/PHP Markdown Readme.text b/PHP Markdown Readme.text index 528eb50..da1d1ee 100644 --- a/PHP Markdown Readme.text +++ b/PHP Markdown Readme.text @@ -202,6 +202,20 @@ Version History Current: +* Enabled reference-style shortcut links. Now you can write reference-style + links with less brakets: + + This is [my website]. + + [my website]: http://example.com/ + + This was added in the 1.0.2 betas, but commented out in the 1.0.1 branch, + waiting for the feature to be officialized. [But half of the other Markdown + implementations are supporting this syntax][half], so it makes sense for + compatibility's sake to allow it in PHP Markdown too. + + [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 + * Fix for adjacent list of different kind where the second list could end as a sublist of the first when not separated by an empty line. diff --git a/markdown.php b/markdown.php index 7c0d7f8..6ed98fd 100644 --- a/markdown.php +++ b/markdown.php @@ -703,14 +703,14 @@ class Markdown_Parser { # These must come last in case you've also got [link text][1] # or [link text](/foo) # -// $text = preg_replace_callback('{ -// ( # wrap whole match in $1 -// \[ -// ([^\[\]]+) # link text = $2; can\'t contain [ or ] -// \] -// ) -// }xs', -// array(&$this, '_doAnchors_reference_callback'), $text); + $text = preg_replace_callback('{ + ( # wrap whole match in $1 + \[ + ([^\[\]]+) # link text = $2; can\'t contain [ or ] + \] + ) + }xs', + array(&$this, '_doAnchors_reference_callback'), $text); $this->in_anchor = false; return $text; From cedf65fe20e17b3ba90af88537bb60437a5a9e42 Mon Sep 17 00:00:00 2001 From: Michel Fortin Date: Sat, 10 Oct 2009 07:54:16 -0400 Subject: [PATCH 2/2] Updated version number to 1.0.1m. --- License.text | 2 +- PHP Markdown Readme.text | 10 +++++----- markdown.php | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/License.text b/License.text index fbde2c0..af8dfa4 100644 --- a/License.text +++ b/License.text @@ -1,5 +1,5 @@ PHP Markdown -Copyright (c) 2004-2008 Michel Fortin +Copyright (c) 2004-2009 Michel Fortin All rights reserved. diff --git a/PHP Markdown Readme.text b/PHP Markdown Readme.text index da1d1ee..3ff0098 100644 --- a/PHP Markdown Readme.text +++ b/PHP Markdown Readme.text @@ -200,7 +200,7 @@ expected; (3) the output PHP Markdown actually produced. Version History --------------- -Current: +1.0.1n (10 Oct 2009): * Enabled reference-style shortcut links. Now you can write reference-style links with less brakets: @@ -216,9 +216,6 @@ Current: [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 -* Fix for adjacent list of different kind where the second list could - end as a sublist of the first when not separated by an empty line. - * Now accepting many valid email addresses in autolinks that were previously rejected, such as: @@ -239,6 +236,9 @@ Current: There is still a quirk which may prevent this from working correctly with relative URLs in inline-style links however. +* Fix for adjacent list of different kind where the second list could + end as a sublist of the first when not separated by an empty line. + * Fixed a bug where inline-style links wouldn't be recognized when the link definition contains a line break between the url and the title. @@ -731,7 +731,7 @@ Copyright and License --------------------- PHP Markdown -Copyright (c) 2004-2007 Michel Fortin +Copyright (c) 2004-2009 Michel Fortin All rights reserved. diff --git a/markdown.php b/markdown.php index 6ed98fd..832808d 100644 --- a/markdown.php +++ b/markdown.php @@ -3,7 +3,7 @@ # Markdown - A text-to-HTML conversion tool for web writers # # PHP Markdown -# Copyright (c) 2004-2008 Michel Fortin +# Copyright (c) 2004-2009 Michel Fortin # # # Original Markdown @@ -12,7 +12,7 @@ # -define( 'MARKDOWN_VERSION', "1.0.1m" ); # Sat 21 Jun 2008 +define( 'MARKDOWN_VERSION', "1.0.1n" ); # Sat 10 Oct 2009 # @@ -62,7 +62,7 @@ function Markdown($text) { Plugin Name: Markdown Plugin URI: http://www.michelf.com/projects/php-markdown/ Description: Markdown syntax allows you to write using an easy-to-read, easy-to-write plain text format. Based on the original Perl version by John Gruber. More... -Version: 1.0.1m +Version: 1.0.1n Author: Michel Fortin Author URI: http://www.michelf.com/ */ @@ -1692,7 +1692,7 @@ Copyright and License --------------------- PHP Markdown -Copyright (c) 2004-2008 Michel Fortin +Copyright (c) 2004-2009 Michel Fortin All rights reserved.