mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
d24439ada0 | |||
1ae100beab | |||
82a5a78a36 | |||
4ede4340ab | |||
170a6bf770 | |||
21db821324 | |||
b384839d15 |
@ -18,11 +18,10 @@ class Parsedown
|
||||
#
|
||||
# Philosophy
|
||||
|
||||
# Markdown is intended to be easy-to-read by humans - those of us who read
|
||||
# line by line, left to right, top to bottom. In order to take advantage of
|
||||
# this, Parsedown tries to read in a similar way. It breaks texts into
|
||||
# lines, it iterates through them and it looks at how they start and relate
|
||||
# to each other.
|
||||
# Parsedown recognises that the Markdown syntax is optimised for humans so
|
||||
# it tries to read like one. It goes through text line by line. It looks at
|
||||
# how lines start to identify blocks. It looks for special characters to
|
||||
# identify inline elements.
|
||||
|
||||
#
|
||||
# ~
|
||||
|
18
README.md
18
README.md
@ -2,8 +2,8 @@
|
||||
|
||||
Better [Markdown](http://en.wikipedia.org/wiki/Markdown) parser for PHP.
|
||||
|
||||
- [Demo](http://parsedown.org/demo)
|
||||
- [Tests](http://parsedown.org/tests/)
|
||||
* [Demo](http://parsedown.org/demo)
|
||||
* [Test Suite](http://parsedown.org/tests/)
|
||||
|
||||
### Features
|
||||
|
||||
@ -12,6 +12,7 @@ Better [Markdown](http://en.wikipedia.org/wiki/Markdown) parser for PHP.
|
||||
* [GitHub Flavored](https://help.github.com/articles/github-flavored-markdown)
|
||||
* [Tested](https://travis-ci.org/erusev/parsedown) in PHP 5.2, 5.3, 5.4, 5.5, 5.6 and [hhvm](http://www.hhvm.com/)
|
||||
* Extensible
|
||||
* [Markdown Extra extension](https://github.com/erusev/parsedown-extra) <sup>new</sup>
|
||||
|
||||
### Installation
|
||||
|
||||
@ -24,3 +25,16 @@ $Parsedown = new Parsedown();
|
||||
|
||||
echo $Parsedown->text('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</em>!</p>
|
||||
```
|
||||
|
||||
More examples in [the wiki](https://github.com/erusev/parsedown/wiki/Usage).
|
||||
|
||||
### Questions
|
||||
|
||||
**How does Parsedown work?**<br/>
|
||||
Parsedown recognises that the Markdown syntax is optimised for humans so it tries to read like one. It goes through text line by line. It looks at how lines start to identify blocks. It looks for special characters to identify inline elements.
|
||||
|
||||
**Why doesn’t Parsedown use namespaces?**<br/>
|
||||
Using namespaces would mean dropping support for PHP 5.2. Since Parsedown is a single class with an uncommon name, making this trade wouldn't make much sense.
|
||||
|
||||
**Who uses Parsedown?**<br/>
|
||||
[phpDocumentor](http://www.phpdoc.org/), [Bolt CMS](http://bolt.cm/), [RaspberryPi.org](http://www.raspberrypi.org/) and [more](https://www.versioneye.com/php/erusev:parsedown/references).
|
||||
|
@ -1,28 +0,0 @@
|
||||
<p>Headings:</p>
|
||||
<h2 id="overview">Overview</h2>
|
||||
<p>blah</p>
|
||||
<H2 id="block">Block Elements</H2>
|
||||
<p>blah</p>
|
||||
<h3 id="span">
|
||||
Span Elements
|
||||
</h3>
|
||||
<p>blah</p>
|
||||
<p>Hr's:</p>
|
||||
<hr>
|
||||
<p>blah</p>
|
||||
<hr/>
|
||||
<p>blah</p>
|
||||
<hr />
|
||||
<p>blah</p>
|
||||
<hr>
|
||||
<p>blah</p>
|
||||
<hr/>
|
||||
<p>blah</p>
|
||||
<hr />
|
||||
<p>blah</p>
|
||||
<hr class="foo" id="bar" />
|
||||
<p>blah</p>
|
||||
<hr class="foo" id="bar"/>
|
||||
<p>blah</p>
|
||||
<hr class="foo" id="bar" >
|
||||
<p>blah</p>
|
@ -1,39 +0,0 @@
|
||||
Headings:
|
||||
|
||||
<h2 id="overview">Overview</h2>
|
||||
blah
|
||||
<H2 id="block">Block Elements</H2>
|
||||
blah
|
||||
<h3 id="span">
|
||||
Span Elements
|
||||
</h3>
|
||||
blah
|
||||
|
||||
Hr's:
|
||||
|
||||
<hr>
|
||||
blah
|
||||
|
||||
<hr/>
|
||||
blah
|
||||
|
||||
<hr />
|
||||
blah
|
||||
|
||||
<hr>
|
||||
blah
|
||||
|
||||
<hr/>
|
||||
blah
|
||||
|
||||
<hr />
|
||||
blah
|
||||
|
||||
<hr class="foo" id="bar" />
|
||||
blah
|
||||
|
||||
<hr class="foo" id="bar"/>
|
||||
blah
|
||||
|
||||
<hr class="foo" id="bar" >
|
||||
blah
|
@ -1,4 +0,0 @@
|
||||
<hr />
|
||||
<p>attributes:</p>
|
||||
<hr style="background: #9bd;" />
|
||||
<p>...</p>
|
@ -1,7 +0,0 @@
|
||||
<hr />
|
||||
|
||||
attributes:
|
||||
|
||||
<hr style="background: #9bd;" />
|
||||
|
||||
...
|
12
test/data/self-closing_html.html
Normal file
12
test/data/self-closing_html.html
Normal file
@ -0,0 +1,12 @@
|
||||
<hr>
|
||||
<p>paragraph</p>
|
||||
<hr/>
|
||||
<p>paragraph</p>
|
||||
<hr />
|
||||
<p>paragraph</p>
|
||||
<hr class="foo" id="bar" />
|
||||
<p>paragraph</p>
|
||||
<hr class="foo" id="bar"/>
|
||||
<p>paragraph</p>
|
||||
<hr class="foo" id="bar" >
|
||||
<p>paragraph</p>
|
12
test/data/self-closing_html.md
Normal file
12
test/data/self-closing_html.md
Normal file
@ -0,0 +1,12 @@
|
||||
<hr>
|
||||
paragraph
|
||||
<hr/>
|
||||
paragraph
|
||||
<hr />
|
||||
paragraph
|
||||
<hr class="foo" id="bar" />
|
||||
paragraph
|
||||
<hr class="foo" id="bar"/>
|
||||
paragraph
|
||||
<hr class="foo" id="bar" >
|
||||
paragraph
|
Reference in New Issue
Block a user