Permalink
Browse files

Added more precision to the predefined URLs and titles feature.

  • Loading branch information...
1 parent 452117f commit 315d1f98065856f94fdbfec8d2bd50cca59977af @michelf committed May 5, 2008
Showing with 11 additions and 3 deletions.
  1. +11 −3 PHP Markdown Readme.text
View
@@ -224,12 +224,20 @@ Current:
as a code block. This has been fixed.
* Added programatically-settable parser properties `predef_urls` and
- `predef_titles` for predefined URLs and link titles. To use this,
- your PHP code must call the parser this way:
+ `predef_titles` for predefined URLs and titles for reference-style
+ links. To use this, your PHP code must call the parser this way:
$parser = new Markdwon_Parser;
- $parser->predef_urls['my_url_ref'] = 'http://example.com';
+ $parser->predef_urls = array('linkref' => 'http://example.com');
$html = $parser->transform($text);
+
+ You can then use the URL as a normal link reference:
+
+ [my link][linkref]
+ [my link][linkRef]
+
+ Reference names in the parser properties *must* be lowercase.
+ Reference names in the Markdown source may have any case.
* Added `setup` and `teardown` methods which can be used by subclassers
as hook points to arrange the state of some parser variables before and

0 comments on commit 315d1f9

Please sign in to comment.