library markdown
WIP: Markdown parser for PHP
bfrohs/markdown
WIP: Markdown parser for PHP
- Tuesday, November 12, 2013
- by bfrohs
- Repository
- 1 Watchers
- 0 Stars
- 20 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 17 Open issues
- 2 Versions
- 0 % Grown
, (*1)
Important: This is an experiment and may be changed, rebased, or trashed at any
point. Use extreme caution before using this code., (*2)
A few things to track:, (*3)
Developer-friendly markdown parser for PHP., (*6)
Using
// If using composer, you're all set
// If not, add the following path to your PSR-0 autoloader: /path/to/markdown/psr-0
// Or include the class manually
// require_once('/path/to/markdown/src/app.php');
// Make `Markdown` an alias for `bfrohs\markdown\Markdown`
use bfrohs\markdown\Markdown;
// Create a new Markdown object with the scope of 'p'
$text = "Some string using *markdown*.";
$markdown = new Markdown($text);
// Convert provided markdown to HTML
$html = $markdown->toHTML();
echo $html; //
Some string using markdown., (*7)
Differences from Dingus
-
Inter-element whitespace is discarded, (*8)
-
Whitespace is collapsed into a single space, (*9)
-
Empty elements are output without trailing slash (ie, <br> instead of <br />), (*10)
-
Currently no support for:, (*11)
- html
<div>
- entities
"
- autolinks
<http://example.com/>
- code blocks
<?php
- reference links
[foo][]