"packages": [
{
"name": "erusev/parsedown",
- "version": "1.6.0",
+ "version": "1.6.1",
"source": {
"type": "git",
"url": "https://github.com/erusev/parsedown.git",
- "reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7"
+ "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/erusev/parsedown/zipball/3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7",
- "reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7",
+ "url": "https://api.github.com/repos/erusev/parsedown/zipball/20ff8bbb57205368b4b42d094642a3e52dac85fb",
+ "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb",
"shasum": ""
},
+ "require": {
+ "php": ">=5.3.0"
+ },
"type": "library",
"autoload": {
"psr-0": {
"markdown",
"parser"
],
- "time": "2015-10-04 16:44:32"
+ "time": "2016-11-02 15:56:58"
},
{
"name": "ezyang/htmlpurifier",
[
- {
- "name": "erusev/parsedown",
- "version": "1.6.0",
- "version_normalized": "1.6.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/erusev/parsedown.git",
- "reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/erusev/parsedown/zipball/3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7",
- "reference": "3ebbd730b5c2cf5ce78bc1bf64071407fc6674b7",
- "shasum": ""
- },
- "time": "2015-10-04 16:44:32",
- "type": "library",
- "installation-source": "dist",
- "autoload": {
- "psr-0": {
- "Parsedown": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Emanuil Rusev",
- "email": "hello@erusev.com",
- "homepage": "http://erusev.com"
- }
- ],
- "description": "Parser for Markdown.",
- "homepage": "http://parsedown.org",
- "keywords": [
- "markdown",
- "parser"
- ]
- },
{
"name": "pelago/emogrifier",
"version": "V1.1.0",
"keywords": [
"html"
]
+ },
+ {
+ "name": "erusev/parsedown",
+ "version": "1.6.1",
+ "version_normalized": "1.6.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/erusev/parsedown.git",
+ "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/erusev/parsedown/zipball/20ff8bbb57205368b4b42d094642a3e52dac85fb",
+ "reference": "20ff8bbb57205368b4b42d094642a3e52dac85fb",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "time": "2016-11-02 15:56:58",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Parsedown": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Emanuil Rusev",
+ "email": "hello@erusev.com",
+ "homepage": "http://erusev.com"
+ }
+ ],
+ "description": "Parser for Markdown.",
+ "homepage": "http://parsedown.org",
+ "keywords": [
+ "markdown",
+ "parser"
+ ]
}
]
language: php
php:
+ - 7.1
- 7.0
- 5.6
- 5.5
matrix:
fast_finish: true
allow_failures:
- - php: 7.0
- php: hhvm-nightly
# Blocks
#
- private function lines(array $lines)
+ protected function lines(array $lines)
{
$CurrentBlock = null;
}
else
{
- if (method_exists($this, 'block'.$CurrentBlock['type'].'Complete'))
+ if ($this->isBlockCompletable($CurrentBlock['type']))
{
$CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock);
}
$Block['identified'] = true;
}
- if (method_exists($this, 'block'.$blockType.'Continue'))
+ if ($this->isBlockContinuable($blockType))
{
$Block['continuable'] = true;
}
# ~
- if (isset($CurrentBlock['continuable']) and method_exists($this, 'block'.$CurrentBlock['type'].'Complete'))
+ if (isset($CurrentBlock['continuable']) and $this->isBlockCompletable($CurrentBlock['type']))
{
$CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock);
}
return $markup;
}
+ protected function isBlockContinuable($Type)
+ {
+ return method_exists($this, 'block'.$Type.'Continue');
+ }
+
+ protected function isBlockCompletable($Type)
+ {
+ return method_exists($this, 'block'.$Type.'Complete');
+ }
+
#
# Code
),
);
+ if($name === 'ol')
+ {
+ $listStart = stristr($matches[0], '.', true);
+
+ if($listStart !== '1')
+ {
+ $Block['element']['attributes'] = array('start' => $listStart);
+ }
+ }
+
$Block['li'] = array(
'name' => 'li',
'handler' => 'li',
+> You might also like [Caret](http://caret.io?ref=parsedown) - our Markdown editor for Mac / Windows / Linux.
+
## Parsedown
[![Build Status](https://img.shields.io/travis/erusev/parsedown/master.svg?style=flat-square)](https://travis-ci.org/erusev/parsedown)
### Features
+* One File
* Super Fast
-* [GitHub flavored](https://help.github.com/articles/github-flavored-markdown)
* Extensible
-* Tested in 5.3 to 5.6
+* [GitHub flavored](https://help.github.com/articles/github-flavored-markdown)
+* Tested in 5.3 to 7.1 and in HHVM
* [Markdown Extra extension](https://github.com/erusev/parsedown-extra)
### Installation
**How does Parsedown work?**
-It tries to read Markdown like a human. First, it looks at the lines. It’s interested in how the lines start. This helps it recognise blocks. It knows, for example, that if a line start with a `-` then it perhaps belong to a list. Once it recognises the blocks, it continues to the content. As it reads, it watches out for special characters. This helps it recognise inline elements (or inlines).
+It tries to read Markdown like a human. First, it looks at the lines. It’s interested in how the lines start. This helps it recognise blocks. It knows, for example, that if a line starts with a `-` then perhaps it belongs to a list. Once it recognises the blocks, it continues to the content. As it reads, it watches out for special characters. This helps it recognise inline elements (or inlines).
We call this approach "line based". We believe that Parsedown is the first Markdown parser to use it. Since the release of Parsedown, other developers have used the same approach to develop other Markdown parsers in PHP and in other languages.
**Who uses it?**
-[phpDocumentor](http://www.phpdoc.org/), [October CMS](http://octobercms.com/), [Bolt CMS](http://bolt.cm/), [Kirby CMS](http://getkirby.com/), [Grav CMS](http://getgrav.org/), [Statamic CMS](http://www.statamic.com/), [RaspberryPi.org](http://www.raspberrypi.org/) and [more](https://www.versioneye.com/php/erusev:parsedown/references).
+[phpDocumentor](http://www.phpdoc.org/), [October CMS](http://octobercms.com/), [Bolt CMS](http://bolt.cm/), [Kirby CMS](http://getkirby.com/), [Grav CMS](http://getgrav.org/), [Statamic CMS](http://www.statamic.com/), [Herbie CMS](http://www.getherbie.org/), [RaspberryPi.org](http://www.raspberrypi.org/) and [more](https://packagist.org/packages/erusev/parsedown/dependents).
**How can I help?**
Use it, star it, share it and if you feel generous, [donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=528P3NZQMP8N2).
-
----
-
-You might also like [Caret](http://caret.io) - our Markdown editor for the desktop.
"homepage": "http://erusev.com"
}
],
+ "require": {
+ "php": ">=5.3.0"
+ },
"autoload": {
"psr-0": {"Parsedown": ""}
}
-}
\ No newline at end of file
+}
public function testLateStaticBinding()
{
- include 'test/TestParsedown.php';
+ include __DIR__ . '/TestParsedown.php';
$parsedown = Parsedown::instance();
$this->assertInstanceOf('Parsedown', $parsedown);
<li>two</li>
</ol>
<p>large numbers:</p>
-<ol>
+<ol start="123">
<li>one</li>
</ol>
\ No newline at end of file