Add support for Parsedown as a markdown parser

This commit is contained in:
Mike van Riel
2013-12-05 09:16:55 +01:00
parent d67d5f41ee
commit 506de88c26
3 changed files with 116 additions and 148 deletions
+2 -1
View File
@@ -15,7 +15,8 @@
"phpunit/phpunit": "3.7.*@stable" "phpunit/phpunit": "3.7.*@stable"
}, },
"suggest": { "suggest": {
"dflydev/markdown": "1.0.*" "dflydev/markdown": "1.0.*",
"erusev/parsedown": "~0.7"
}, },
"extra": { "extra": {
"branch-alias": { "branch-alias": {
Generated
+103 -139
View File
@@ -1,90 +1,46 @@
{ {
"hash": "c6115c20a4a284f6ca14e676e788b4d3", "_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
"hash": "f55ecb41312789bb8b3fa8b4f659952f",
"packages": [ "packages": [
{
"name": "dflydev/markdown",
"version": "v1.0.2",
"source": {
"type": "git",
"url": "https://github.com/dflydev/dflydev-markdown.git",
"reference": "v1.0.2"
},
"dist": {
"type": "zip",
"url": "https://github.com/dflydev/dflydev-markdown/zipball/v1.0.2",
"reference": "v1.0.2",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"time": "2012-01-15 19:36:37",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"dflydev\\markdown": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"New BSD License"
],
"authors": [
{
"name": "Dragonfly Development Inc.",
"email": "[email protected]",
"homepage": "http://dflydev.com"
},
{
"name": "Beau Simensen",
"email": "[email protected]",
"homepage": "http://beausimensen.com"
},
{
"name": "Michel Fortin",
"homepage": "http://michelf.com"
},
{
"name": "John Gruber",
"homepage": "http://daringfireball.net"
}
],
"description": "PHP Markdown & Extra",
"homepage": "http://github.com/dflydev/dflydev-markdown",
"keywords": [
"markdown"
]
}
], ],
"packages-dev": [ "packages-dev": [
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "1.2.7", "version": "1.2.13",
"source": { "source": {
"type": "git", "type": "git",
"url": "git://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "1.2.7" "reference": "466e7cd2554b4e264c9e3f31216d25ac0e5f3d94"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/sebastianbergmann/php-code-coverage/archive/1.2.7.zip", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/466e7cd2554b4e264c9e3f31216d25ac0e5f3d94",
"reference": "1.2.7", "reference": "466e7cd2554b4e264c9e3f31216d25ac0e5f3d94",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
"phpunit/php-file-iterator": ">=1.3.0@stable", "phpunit/php-file-iterator": ">=1.3.0@stable",
"phpunit/php-token-stream": ">=1.1.3@stable", "phpunit/php-text-template": ">=1.1.1@stable",
"phpunit/php-text-template": ">=1.1.1@stable" "phpunit/php-token-stream": ">=1.1.3@stable"
},
"require-dev": {
"phpunit/phpunit": "3.7.*@dev"
}, },
"suggest": { "suggest": {
"ext-dom": "*", "ext-dom": "*",
"ext-xdebug": ">=2.0.5" "ext-xdebug": ">=2.0.5"
}, },
"time": "2012-12-02 14:54:55",
"type": "library", "type": "library",
"installation-source": "dist", "extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": { "autoload": {
"classmap": [ "classmap": [
"PHP/" "PHP/"
@@ -107,31 +63,30 @@
"description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
"homepage": "https://github.com/sebastianbergmann/php-code-coverage", "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
"keywords": [ "keywords": [
"testing",
"coverage", "coverage",
"testing",
"xunit" "xunit"
] ],
"time": "2013-09-10 08:14:32"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
"version": "1.3.3", "version": "1.3.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "git://github.com/sebastianbergmann/php-file-iterator.git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "1.3.3" "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/sebastianbergmann/php-file-iterator/zipball/1.3.3", "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb",
"reference": "1.3.3", "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"time": "2012-10-11 04:44:38",
"type": "library", "type": "library",
"installation-source": "dist",
"autoload": { "autoload": {
"classmap": [ "classmap": [
"File/" "File/"
@@ -152,32 +107,31 @@
} }
], ],
"description": "FilterIterator implementation that filters files based on a list of suffixes.", "description": "FilterIterator implementation that filters files based on a list of suffixes.",
"homepage": "http://www.phpunit.de/", "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
"keywords": [ "keywords": [
"filesystem", "filesystem",
"iterator" "iterator"
] ],
"time": "2013-10-10 15:34:57"
}, },
{ {
"name": "phpunit/php-text-template", "name": "phpunit/php-text-template",
"version": "1.1.4", "version": "1.1.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "git://github.com/sebastianbergmann/php-text-template.git", "url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "1.1.4" "reference": "5180896f51c5b3648ac946b05f9ec02be78a0b23"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/sebastianbergmann/php-text-template/zipball/1.1.4", "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5180896f51c5b3648ac946b05f9ec02be78a0b23",
"reference": "1.1.4", "reference": "5180896f51c5b3648ac946b05f9ec02be78a0b23",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"time": "2012-10-31 11:15:28",
"type": "library", "type": "library",
"installation-source": "dist",
"autoload": { "autoload": {
"classmap": [ "classmap": [
"Text/" "Text/"
@@ -201,28 +155,27 @@
"homepage": "https://github.com/sebastianbergmann/php-text-template/", "homepage": "https://github.com/sebastianbergmann/php-text-template/",
"keywords": [ "keywords": [
"template" "template"
] ],
"time": "2012-10-31 18:15:28"
}, },
{ {
"name": "phpunit/php-timer", "name": "phpunit/php-timer",
"version": "1.0.4", "version": "1.0.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "git://github.com/sebastianbergmann/php-timer.git", "url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "1.0.4" "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/sebastianbergmann/php-timer/zipball/1.0.4", "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
"reference": "1.0.4", "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"time": "2012-10-11 04:45:58",
"type": "library", "type": "library",
"installation-source": "dist",
"autoload": { "autoload": {
"classmap": [ "classmap": [
"PHP/" "PHP/"
@@ -243,32 +196,36 @@
} }
], ],
"description": "Utility class for timing", "description": "Utility class for timing",
"homepage": "http://www.phpunit.de/", "homepage": "https://github.com/sebastianbergmann/php-timer/",
"keywords": [ "keywords": [
"timer" "timer"
] ],
"time": "2013-08-02 07:42:54"
}, },
{ {
"name": "phpunit/php-token-stream", "name": "phpunit/php-token-stream",
"version": "1.1.5", "version": "1.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "git://github.com/sebastianbergmann/php-token-stream.git", "url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "1.1.5" "reference": "5220af2a7929aa35cf663d97c89ad3d50cf5fa3e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/sebastianbergmann/php-token-stream/zipball/1.1.5", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/5220af2a7929aa35cf663d97c89ad3d50cf5fa3e",
"reference": "1.1.5", "reference": "5220af2a7929aa35cf663d97c89ad3d50cf5fa3e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"ext-tokenizer": "*", "ext-tokenizer": "*",
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"time": "2012-10-11 04:47:14",
"type": "library", "type": "library",
"installation-source": "dist", "extra": {
"branch-alias": {
"dev-master": "1.2-dev"
}
},
"autoload": { "autoload": {
"classmap": [ "classmap": [
"PHP/" "PHP/"
@@ -289,45 +246,48 @@
} }
], ],
"description": "Wrapper around PHP's tokenizer extension.", "description": "Wrapper around PHP's tokenizer extension.",
"homepage": "http://www.phpunit.de/", "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
"keywords": [ "keywords": [
"tokenizer" "tokenizer"
] ],
"time": "2013-09-13 04:58:23"
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "3.7.10", "version": "3.7.28",
"source": { "source": {
"type": "git", "type": "git",
"url": "git://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "3.7.10" "reference": "3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/sebastianbergmann/phpunit/archive/3.7.10.zip", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d",
"reference": "3.7.10", "reference": "3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3",
"phpunit/php-file-iterator": ">=1.3.1",
"phpunit/php-text-template": ">=1.1.1",
"phpunit/php-code-coverage": ">=1.2.1",
"phpunit/php-timer": ">=1.0.2",
"phpunit/phpunit-mock-objects": ">=1.2.0,<1.3.0",
"symfony/yaml": ">=2.1.0",
"ext-dom": "*", "ext-dom": "*",
"ext-pcre": "*", "ext-pcre": "*",
"ext-reflection": "*", "ext-reflection": "*",
"ext-spl": "*" "ext-spl": "*",
"php": ">=5.3.3",
"phpunit/php-code-coverage": "~1.2.1",
"phpunit/php-file-iterator": ">=1.3.1",
"phpunit/php-text-template": ">=1.1.1",
"phpunit/php-timer": ">=1.0.4",
"phpunit/phpunit-mock-objects": "~1.2.0",
"symfony/yaml": "~2.0"
},
"require-dev": {
"pear-pear/pear": "1.9.4"
}, },
"suggest": { "suggest": {
"phpunit/php-invoker": ">=1.1.0",
"ext-json": "*", "ext-json": "*",
"ext-simplexml": "*", "ext-simplexml": "*",
"ext-tokenizer": "*" "ext-tokenizer": "*",
"phpunit/php-invoker": ">=1.1.0,<1.2.0"
}, },
"time": "2012-12-02 14:56:55",
"bin": [ "bin": [
"composer/bin/phpunit" "composer/bin/phpunit"
], ],
@@ -337,7 +297,6 @@
"dev-master": "3.7.x-dev" "dev-master": "3.7.x-dev"
} }
}, },
"installation-source": "dist",
"autoload": { "autoload": {
"classmap": [ "classmap": [
"PHPUnit/" "PHPUnit/"
@@ -361,23 +320,24 @@
"description": "The PHP Unit Testing framework.", "description": "The PHP Unit Testing framework.",
"homepage": "http://www.phpunit.de/", "homepage": "http://www.phpunit.de/",
"keywords": [ "keywords": [
"testing",
"phpunit", "phpunit",
"testing",
"xunit" "xunit"
] ],
"time": "2013-10-17 07:27:40"
}, },
{ {
"name": "phpunit/phpunit-mock-objects", "name": "phpunit/phpunit-mock-objects",
"version": "1.2.2", "version": "1.2.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "git://github.com/sebastianbergmann/phpunit-mock-objects.git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "1.2.2" "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects/archive/1.2.2.zip", "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875",
"reference": "1.2.2", "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -387,9 +347,7 @@
"suggest": { "suggest": {
"ext-soap": "*" "ext-soap": "*"
}, },
"time": "2012-11-05 10:39:13",
"type": "library", "type": "library",
"installation-source": "dist",
"autoload": { "autoload": {
"classmap": [ "classmap": [
"PHPUnit/" "PHPUnit/"
@@ -414,37 +372,36 @@
"keywords": [ "keywords": [
"mock", "mock",
"xunit" "xunit"
] ],
"time": "2013-01-13 10:24:48"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v2.1.4", "version": "v2.4.0",
"target-dir": "Symfony/Component/Yaml", "target-dir": "Symfony/Component/Yaml",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/Yaml", "url": "https://github.com/symfony/Yaml.git",
"reference": "v2.1.4" "reference": "1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://github.com/symfony/Yaml/archive/v2.1.4.zip", "url": "https://api.github.com/repos/symfony/Yaml/zipball/1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5",
"reference": "v2.1.4", "reference": "1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"time": "2012-11-08 09:51:48",
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "2.1-dev" "dev-master": "2.4-dev"
} }
}, },
"installation-source": "dist",
"autoload": { "autoload": {
"psr-0": { "psr-0": {
"Symfony\\Component\\Yaml": "" "Symfony\\Component\\Yaml\\": ""
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@@ -462,7 +419,8 @@
} }
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "http://symfony.com" "homepage": "http://symfony.com",
"time": "2013-11-26 16:40:27"
} }
], ],
"aliases": [ "aliases": [
@@ -471,5 +429,11 @@
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": { "stability-flags": {
"phpunit/phpunit": 0 "phpunit/phpunit": 0
} },
"platform": {
"php": ">=5.3.3"
},
"platform-dev": [
]
} }
@@ -161,7 +161,10 @@ class Description implements \Reflector
); );
} }
if (class_exists('dflydev\markdown\MarkdownExtraParser')) { if (class_exists('Parsedown')) {
$markdown = \Parsedown::instance();
$result = $markdown->parse($result);
} elseif (class_exists('dflydev\markdown\MarkdownExtraParser')) {
$markdown = new \dflydev\markdown\MarkdownExtraParser(); $markdown = new \dflydev\markdown\MarkdownExtraParser();
$result = $markdown->transformMarkdown($result); $result = $markdown->transformMarkdown($result);
} }