mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
fbe3fe878f | |||
09827f542c | |||
70ef6f5521 | |||
691e36b1f2 | |||
af6affdc2c | |||
9cf41f27ab | |||
16aadff2ed | |||
07c937583d | |||
728952b90a | |||
c82af01bd6 | |||
593ffd45a3 | |||
f76b10aaab | |||
29ad172261 | |||
924b26e16c | |||
4367f89a74 | |||
1bf24f7334 | |||
0a09d5ad45 | |||
3fc442b078 | |||
bd0e31a7dd | |||
dfaf03639a | |||
7081afe8cb | |||
4b6493999a | |||
0172d779d7 | |||
cc5b38ca39 | |||
48351504de | |||
b5951e08c6 |
5
.gitattributes
vendored
Normal file
5
.gitattributes
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Ignore all tests for archive
|
||||||
|
/test export-ignore
|
||||||
|
/.gitattributes export-ignore
|
||||||
|
/.travis.yml export-ignore
|
||||||
|
/phpunit.xml.dist export-ignore
|
29
.travis.yml
29
.travis.yml
@ -1,16 +1,27 @@
|
|||||||
language: php
|
language: php
|
||||||
|
|
||||||
php:
|
dist: trusty
|
||||||
- 7.1
|
sudo: false
|
||||||
- 7.0
|
|
||||||
- 5.6
|
|
||||||
- 5.5
|
|
||||||
- 5.4
|
|
||||||
- 5.3
|
|
||||||
- hhvm
|
|
||||||
- hhvm-nightly
|
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
|
include:
|
||||||
|
- php: 5.3
|
||||||
|
dist: precise
|
||||||
|
- php: 5.4
|
||||||
|
- php: 5.5
|
||||||
|
- php: 5.6
|
||||||
|
- php: 7.0
|
||||||
|
- php: 7.1
|
||||||
|
- php: nightly
|
||||||
|
- php: hhvm
|
||||||
|
- php: hhvm-nightly
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
|
- php: nightly
|
||||||
- php: hhvm-nightly
|
- php: hhvm-nightly
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- composer install --prefer-dist --no-interaction --no-progress
|
||||||
|
|
||||||
|
script:
|
||||||
|
- vendor/bin/phpunit
|
||||||
|
@ -448,7 +448,7 @@ class Parsedown
|
|||||||
return $Block;
|
return $Block;
|
||||||
}
|
}
|
||||||
|
|
||||||
$Block['element']['text']['text'] .= "\n".$Line['body'];;
|
$Block['element']['text']['text'] .= "\n".$Line['body'];
|
||||||
|
|
||||||
return $Block;
|
return $Block;
|
||||||
}
|
}
|
||||||
@ -1204,7 +1204,7 @@ class Parsedown
|
|||||||
|
|
||||||
$remainder = $Excerpt['text'];
|
$remainder = $Excerpt['text'];
|
||||||
|
|
||||||
if (preg_match('/\[((?:[^][]|(?R))*)\]/', $remainder, $matches))
|
if (preg_match('/\[((?:[^][]++|(?R))*+)\]/', $remainder, $matches))
|
||||||
{
|
{
|
||||||
$Element['text'] = $matches[1];
|
$Element['text'] = $matches[1];
|
||||||
|
|
||||||
@ -1217,7 +1217,7 @@ class Parsedown
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/^[(]((?:[^ ()]|[(][^ )]+[)])+)(?:[ ]+("[^"]*"|\'[^\']*\'))?[)]/', $remainder, $matches))
|
if (preg_match('/^[(]\s*+((?:[^ ()]++|[(][^ )]+[)])++)(?:[ ]+("[^"]*"|\'[^\']*\'))?\s*[)]/', $remainder, $matches))
|
||||||
{
|
{
|
||||||
$Element['attributes']['href'] = $matches[1];
|
$Element['attributes']['href'] = $matches[1];
|
||||||
|
|
||||||
@ -1539,10 +1539,10 @@ class Parsedown
|
|||||||
'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing',
|
'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing',
|
||||||
'i', 'rp', 'del', 'code', 'strike', 'marquee',
|
'i', 'rp', 'del', 'code', 'strike', 'marquee',
|
||||||
'q', 'rt', 'ins', 'font', 'strong',
|
'q', 'rt', 'ins', 'font', 'strong',
|
||||||
's', 'tt', 'sub', 'mark',
|
's', 'tt', 'kbd', 'mark',
|
||||||
'u', 'xm', 'sup', 'nobr',
|
'u', 'xm', 'sub', 'nobr',
|
||||||
'var', 'ruby',
|
'sup', 'ruby',
|
||||||
'wbr', 'span',
|
'var', 'span',
|
||||||
'time',
|
'wbr', 'time',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
> You might also like [Caret](http://caret.io?ref=parsedown) - our Markdown editor for Mac / Windows / Linux.
|
> You might also like [Caret](https://caret.io?ref=parsedown) - our Markdown editor for Mac / Windows / Linux.
|
||||||
|
|
||||||
## Parsedown
|
## Parsedown
|
||||||
|
|
||||||
@ -15,6 +15,7 @@ Better Markdown Parser in PHP
|
|||||||
### Features
|
### Features
|
||||||
|
|
||||||
* One File
|
* One File
|
||||||
|
* No Dependencies
|
||||||
* Super Fast
|
* Super Fast
|
||||||
* Extensible
|
* Extensible
|
||||||
* [GitHub flavored](https://help.github.com/articles/github-flavored-markdown)
|
* [GitHub flavored](https://help.github.com/articles/github-flavored-markdown)
|
||||||
@ -35,6 +36,10 @@ echo $Parsedown->text('Hello _Parsedown_!'); # prints: <p>Hello <em>Parsedown</e
|
|||||||
|
|
||||||
More examples in [the wiki](https://github.com/erusev/parsedown/wiki/) and in [this video tutorial](http://youtu.be/wYZBY8DEikI).
|
More examples in [the wiki](https://github.com/erusev/parsedown/wiki/) and in [this video tutorial](http://youtu.be/wYZBY8DEikI).
|
||||||
|
|
||||||
|
### Security
|
||||||
|
|
||||||
|
Parsedown does not sanitize the HTML that it generates. When you deal with untrusted content (ex: user commnets) you should also use a HTML sanitizer like [HTML Purifier](http://htmlpurifier.org/).
|
||||||
|
|
||||||
### Questions
|
### Questions
|
||||||
|
|
||||||
**How does Parsedown work?**
|
**How does Parsedown work?**
|
||||||
@ -49,7 +54,7 @@ It passes most of the CommonMark tests. Most of the tests that don't pass deal w
|
|||||||
|
|
||||||
**Who uses it?**
|
**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/), [Herbie CMS](http://www.getherbie.org/), [RaspberryPi.org](http://www.raspberrypi.org/) and [more](https://packagist.org/packages/erusev/parsedown/dependents).
|
[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/), [Symfony demo](https://github.com/symfony/symfony-demo) and [more](https://packagist.org/packages/erusev/parsedown/dependents).
|
||||||
|
|
||||||
**How can I help?**
|
**How can I help?**
|
||||||
|
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.0"
|
"php": ">=5.3.0"
|
||||||
},
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^4.8.35"
|
||||||
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-0": {"Parsedown": ""}
|
"psr-0": {"Parsedown": ""}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,10 @@
|
|||||||
* @link http://commonmark.org/ CommonMark
|
* @link http://commonmark.org/ CommonMark
|
||||||
* @link http://git.io/8WtRvQ JavaScript test runner
|
* @link http://git.io/8WtRvQ JavaScript test runner
|
||||||
*/
|
*/
|
||||||
class CommonMarkTest extends PHPUnit_Framework_TestCase
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
class CommonMarkTest extends TestCase
|
||||||
{
|
{
|
||||||
const SPEC_URL = 'https://raw.githubusercontent.com/jgm/stmd/master/spec.txt';
|
const SPEC_URL = 'https://raw.githubusercontent.com/jgm/stmd/master/spec.txt';
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class ParsedownTest extends PHPUnit_Framework_TestCase
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
class ParsedownTest extends TestCase
|
||||||
{
|
{
|
||||||
final function __construct($name = null, array $data = array(), $dataName = '')
|
final function __construct($name = null, array $data = array(), $dataName = '')
|
||||||
{
|
{
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user