Skip to content
Browse files

Enabled reference-style shortcuts.

  • Loading branch information...
1 parent d64613d commit 7123d05395ed3b79f9400cdf2a7cd9846e2bd078 @michelf committed Oct 10, 2009
Showing with 22 additions and 8 deletions.
  1. +14 −0 PHP Markdown Readme.text
  2. +8 −8 markdown.php
View
14 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.
View
16 markdown.php
@@ -703,14 +703,14 @@ function doAnchors($text) {
# 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;

0 comments on commit 7123d05

Please sign in to comment.
Something went wrong with that request. Please try again.