Skip to content

Instantly share code, notes, and snippets.

@SeanJA
Created September 30, 2010 19:19
Show Gist options
  • Select an option

  • Save SeanJA/605148 to your computer and use it in GitHub Desktop.

Select an option

Save SeanJA/605148 to your computer and use it in GitHub Desktop.
<?php
include 'classes/markdown.php';
$parser = new Markdown();
//Transform text using parser.
echo $parser->transform($text);
<?php
include 'classes/markdown.php';
class myMarkdown extends Markdown{
public function __invoke($text) {
return $this->transform($text);
}
}
$parser = new myMarkdown();
echo $parser($text);
@SeanJA
Copy link
Copy Markdown
Author

SeanJA commented Sep 30, 2010

not really sure what the advantage is here... it is kind of neat though

@SeanJA
Copy link
Copy Markdown
Author

SeanJA commented Sep 30, 2010

You don't actually need to do this with the markdown parser, it is already part of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment