forked from cebe/markdown
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes cebe#34
- Loading branch information
Showing
10 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
<?php | ||
/** | ||
* @copyright Copyright (c) 2014 Carsten Brandt | ||
* @license https://github.com/cebe/markdown/blob/master/LICENSE | ||
* @link https://github.com/cebe/markdown#readme | ||
*/ | ||
|
||
namespace cebe\markdown; | ||
|
||
/** | ||
* Markdown parser for github flavored markdown | ||
* Markdown parser for github flavored markdown. | ||
* | ||
* @author Carsten Brandt <[email protected]> | ||
* @license https://github.com/cebe/markdown/blob/master/LICENSE | ||
* @link https://github.com/cebe/markdown#readme | ||
*/ | ||
class GithubMarkdown extends Markdown | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
<?php | ||
/** | ||
* @copyright Copyright (c) 2014 Carsten Brandt | ||
* @license https://github.com/cebe/markdown/blob/master/LICENSE | ||
* @link https://github.com/cebe/markdown#readme | ||
*/ | ||
|
||
namespace cebe\markdown; | ||
|
||
|
@@ -9,8 +14,6 @@ | |
* Markdown parser for the [initial markdown spec](http://daringfireball.net/projects/markdown/syntax). | ||
* | ||
* @author Carsten Brandt <[email protected]> | ||
* @license https://github.com/cebe/markdown/blob/master/LICENSE | ||
* @link https://github.com/cebe/markdown#readme | ||
*/ | ||
class Markdown extends Parser | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
<?php | ||
/** | ||
* @copyright Copyright (c) 2014 Carsten Brandt | ||
* @license https://github.com/cebe/markdown/blob/master/LICENSE | ||
* @link https://github.com/cebe/markdown#readme | ||
*/ | ||
|
||
namespace cebe\markdown; | ||
|
||
/** | ||
* A generic parser for markdown-like languages. | ||
* | ||
* @author Carsten Brandt <[email protected]> | ||
* @license https://github.com/cebe/markdown/blob/master/LICENSE | ||
* @link https://github.com/cebe/markdown#readme | ||
*/ | ||
class Parser | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,10 +31,12 @@ Future plans are to support: | |
|
||
### Who is using it? | ||
|
||
- It powers the API-docs and the definitive guide for the [Yii Framework][] [2.0](https://github.com/yiisoft/yii2). Pre-beta preview is hosted here: http://stuff.cebe.cc/yii2docs/guide_index.html | ||
- It powers the API-docs and the definitive guide for the [Yii Framework][] [2.0](https://github.com/yiisoft/yii2). | ||
The pre-beta preview is hosted here: http://stuff.cebe.cc/yii2docs/guide_index.html | ||
|
||
[Yii Framework]: http://www.yiiframework.com/ "The Yii PHP Framework" | ||
|
||
|
||
Installation | ||
------------ | ||
|
||
|
@@ -230,6 +232,13 @@ class MyMarkdown extends \cebe\markdown\Markdown | |
``` | ||
|
||
|
||
Acknowledgements | ||
---------------- | ||
|
||
I'd like to thank @erusev for creating [Parsedown][] which heavily influenced this work and provided | ||
the idea of the line based parsing approach. | ||
|
||
|
||
FAQ | ||
--- | ||
|
||
|
@@ -262,6 +271,13 @@ to using callbacks to inject functionallity into the parser. | |
Just [open an issue][] on github, post your markdown code and describe the problem. You may also attach screenshots of the rendered HTML result to describe your problem. | ||
|
||
|
||
### Am I free to use this? | ||
|
||
This library is open source and licensed under the [MIT License][]. This means that you can do whatever you want | ||
with it as long as you mention my name and include the [license file][license]. Check the [license][] for details. | ||
|
||
[MIT License]: http://opensource.org/licenses/MIT | ||
|
||
Contact | ||
------- | ||
|
||
|
@@ -276,3 +292,4 @@ Feel free to contact me using [email](mailto:[email protected]) or [twitter](https:// | |
[Yii framework 2.0]: https://github.com/yiisoft/yii2 | ||
[real parser]: http://en.wikipedia.org/wiki/Parsing#Types_of_parser | ||
[open an issue]: https://github.com/cebe/markdown/issues/new | ||
[license]: https://github.com/cebe/markdown/blob/master/LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
<?php | ||
/** | ||
* @copyright Copyright (c) 2014 Carsten Brandt | ||
* @license https://github.com/cebe/markdown/blob/master/LICENSE | ||
* @link https://github.com/cebe/markdown#readme | ||
*/ | ||
|
||
namespace cebe\markdown\tests; | ||
|
||
use cebe\markdown\Markdown; | ||
|
||
/** | ||
* Base class for all Test cases. | ||
* | ||
* @author Carsten Brandt <[email protected]> | ||
*/ | ||
abstract class BaseMarkdownTest extends \PHPUnit_Framework_TestCase | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
<?php | ||
/** | ||
* @copyright Copyright (c) 2014 Carsten Brandt | ||
* @license https://github.com/cebe/markdown/blob/master/LICENSE | ||
* @link https://github.com/cebe/markdown#readme | ||
*/ | ||
|
||
namespace cebe\markdown\tests; | ||
use cebe\markdown\GithubMarkdown; | ||
|
||
/** | ||
* Test case for the github flavored markdown. | ||
* | ||
* @author Carsten Brandt <[email protected]> | ||
*/ | ||
class GithubMarkdownTest extends BaseMarkdownTest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
<?php | ||
/** | ||
* @copyright Copyright (c) 2014 Carsten Brandt | ||
* @license https://github.com/cebe/markdown/blob/master/LICENSE | ||
* @link https://github.com/cebe/markdown#readme | ||
*/ | ||
|
||
namespace cebe\markdown\tests; | ||
|
||
use cebe\markdown\Markdown; | ||
|
||
/** | ||
* Test case for traditional markdown. | ||
* | ||
* @author Carsten Brandt <[email protected]> | ||
*/ | ||
class MarkdownTest extends BaseMarkdownTest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
<?php | ||
/** | ||
* @author Carsten Brandt <[email protected]> | ||
*/ | ||
|
||
require(__DIR__ . '/../Parser.php'); | ||
require(__DIR__ . '/../Markdown.php'); | ||
|