commit
a56f6869f6
6 changed files with 50 additions and 5 deletions
25
.github/workflows/ci.yml
vendored
Normal file
25
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
name: CI
|
||||
on:
|
||||
pull_request: null
|
||||
push:
|
||||
branches:
|
||||
- lib
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php: ['7.4', '8.0']
|
||||
|
||||
name: Linting - PHP ${{ matrix.php }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: none
|
||||
extensions: intl
|
||||
- run: composer install --no-progress
|
||||
# - run: composer codestyle
|
||||
- run: composer phpstan
|
||||
- run: composer tests
|
||||
|
|
@ -708,7 +708,7 @@ class Markdown implements MarkdownInterface {
|
|||
|
||||
/**
|
||||
* Callback method to parse referenced anchors
|
||||
* @param string $matches
|
||||
* @param array $matches
|
||||
* @return string
|
||||
*/
|
||||
protected function _doAnchors_reference_callback($matches) {
|
||||
|
|
@ -747,7 +747,7 @@ class Markdown implements MarkdownInterface {
|
|||
|
||||
/**
|
||||
* Callback method to parse inline anchors
|
||||
* @param string $matches
|
||||
* @param array $matches
|
||||
* @return string
|
||||
*/
|
||||
protected function _doAnchors_inline_callback($matches) {
|
||||
|
|
@ -765,7 +765,7 @@ class Markdown implements MarkdownInterface {
|
|||
$url = $this->encodeURLAttribute($url);
|
||||
|
||||
$result = "<a href=\"$url\"";
|
||||
if (isset($title)) {
|
||||
if ($title) {
|
||||
$title = $this->encodeAttribute($title);
|
||||
$result .= " title=\"$title\"";
|
||||
}
|
||||
|
|
@ -1808,7 +1808,7 @@ class Markdown implements MarkdownInterface {
|
|||
/**
|
||||
* String length function for detab. `_initDetab` will create a function to
|
||||
* handle UTF-8 if the default function does not exist.
|
||||
* @var string
|
||||
* can be a string or function
|
||||
*/
|
||||
protected $utf8_strlen = 'mb_strlen';
|
||||
|
||||
|
|
|
|||
|
|
@ -1222,6 +1222,7 @@ class MarkdownExtra extends \Michelf\Markdown {
|
|||
$head = $matches[1];
|
||||
$underline = $matches[2];
|
||||
$content = $matches[3];
|
||||
$attr = [];
|
||||
|
||||
// Remove any tailing pipes for each line.
|
||||
$head = preg_replace('/[|] *$/m', '', $head);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
PHP Markdown
|
||||
============
|
||||
|
||||

|
||||
|
||||
PHP Markdown Lib 1.9.0 - 1 Dec 2019
|
||||
|
||||
by Michel Fortin
|
||||
|
|
|
|||
|
|
@ -24,6 +24,21 @@
|
|||
"psr-4": { "Michelf\\": "Michelf/" }
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": ">= 9.5"
|
||||
"phpspec/prophecy": "^1.6",
|
||||
"friendsofphp/php-cs-fixer": "^3.0",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"phpstan/phpstan": "^1.0",
|
||||
"phpstan/phpstan-phpunit": "^1.0"
|
||||
},
|
||||
|
||||
"scripts": {
|
||||
"tests": "vendor/bin/phpunit test/",
|
||||
"phpstan": [
|
||||
"vendor/bin/phpstan analyse Michelf/ --level=5",
|
||||
"vendor/bin/phpstan analyse -c test/phpstan.neon test/ --level=5"
|
||||
],
|
||||
"codestyle": "vendor/bin/php-cs-fixer fix Michelf --dry-run --verbose --show-progress=none",
|
||||
"codestyle-fix": "vendor/bin/php-cs-fixer fix Michelf"
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
2
test/phpstan.neon
Normal file
2
test/phpstan.neon
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
includes:
|
||||
- ../vendor/phpstan/phpstan-phpunit/extension.neon
|
||||
Loading…
Reference in a new issue