Skip to content

Commit

Permalink
Added more precision to the predefined URLs and titles feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
michelf committed May 5, 2008
1 parent 452117f commit 315d1f9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions PHP Markdown Readme.text
Expand Up @@ -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
Expand Down

0 comments on commit 315d1f9

Please sign in to comment.