Skip to content

Commit

Permalink
Enabled reference-style shortcuts.
Browse files Browse the repository at this point in the history
  • Loading branch information
michelf committed Oct 10, 2009
1 parent d64613d commit 7123d05
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
14 changes: 14 additions & 0 deletions PHP Markdown Readme.text
Expand Up @@ -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.

Expand Down
16 changes: 8 additions & 8 deletions markdown.php
Expand Up @@ -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;
Expand Down

0 comments on commit 7123d05

Please sign in to comment.