From 87b57bf3cbf0bf5024070a8a7379e6c216a44169 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Wed, 10 Apr 2019 21:54:34 +0100 Subject: [PATCH 1/8] Add test to prevent regression --- test/data/fenced_code_block.html | 4 +++- test/data/fenced_code_block.md | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/data/fenced_code_block.html b/test/data/fenced_code_block.html index 50d39df22..8ef93ae7e 100644 --- a/test/data/fenced_code_block.html +++ b/test/data/fenced_code_block.html @@ -15,4 +15,6 @@
foo
 
 
-bar
\ No newline at end of file +bar +
<?php
+echo "Hello World";
\ No newline at end of file diff --git a/test/data/fenced_code_block.md b/test/data/fenced_code_block.md index 3e4155a88..81ca2bae9 100644 --- a/test/data/fenced_code_block.md +++ b/test/data/fenced_code_block.md @@ -35,4 +35,9 @@ foo bar +``` + +```php some-class + Date: Sat, 16 Mar 2024 02:44:40 +0700 Subject: [PATCH 2/8] [PHP 8.4] Fixes for implicit nullability deprecation Fixes all issues that emit deprecation notices on PHP 8.4 for implicit nullable parameter type declarations. See: - [RFC](https://wiki.php.net/rfc/deprecate-implicitly-nullable-types) - [PHP 8.4: Implicitly nullable parameter declarations deprecated](https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated) --- Parsedown.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index 46974ff35..01eb8e226 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -570,7 +570,7 @@ protected function blockHeader($Line) # # List - protected function blockList($Line, array $CurrentBlock = null) + protected function blockList($Line, ?array $CurrentBlock = null) { list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]{1,9}+[.\)]'); @@ -807,7 +807,7 @@ protected function blockRule($Line) # # Setext - protected function blockSetextHeader($Line, array $Block = null) + protected function blockSetextHeader($Line, ?array $Block = null) { if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) { @@ -893,7 +893,7 @@ protected function blockReference($Line) # # Table - protected function blockTable($Line, array $Block = null) + protected function blockTable($Line, ?array $Block = null) { if ( ! isset($Block) or $Block['type'] !== 'Paragraph' or isset($Block['interrupted'])) { From 54f1ffc214d187895265e5ba1a7af4abad4f4d1a Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Mon, 15 Jul 2024 10:19:33 +0200 Subject: [PATCH 3/8] drop support for PHP < 7.1 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f8b40f8ce..b145680a2 100644 --- a/composer.json +++ b/composer.json @@ -13,11 +13,11 @@ } ], "require": { - "php": ">=5.3.0", + "php": ">=7.1", "ext-mbstring": "*" }, "require-dev": { - "phpunit/phpunit": "^4.8.35" + "phpunit/phpunit": "^7.5|^8.5|^9.6" }, "autoload": { "psr-0": {"Parsedown": ""} From 44fd383db76a61251b69d8f7680f755f33cf02db Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 9 Jul 2024 14:40:58 +0200 Subject: [PATCH 4/8] run tests using GitHub actions --- .github/workflows/unit-tests.yaml | 37 +++++++++++++++++++++++++++++++ .travis.yml | 28 ----------------------- test/CommonMarkTestStrict.php | 4 +++- 3 files changed, 40 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/unit-tests.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml new file mode 100644 index 000000000..ba7a80b9b --- /dev/null +++ b/.github/workflows/unit-tests.yaml @@ -0,0 +1,37 @@ +on: + - push + - pull_request + +jobs: + phpunit: + runs-on: ubuntu-latest + + strategy: + matrix: + include: + - '7.1' + - '7.2' + - '7.3' + - '7.4' + - '8.0' + - '8.1' + - '8.2' + - '8.3' + - '8.4' + + steps: + - name: Checkout the source code + uses: actions/checkout@v4 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '${{ matrix.php }}' + + - name: Install dependencies + run: composer install + + - name: Run tests + run: | + vendor/bin/phpunit + vendor/bin/phpunit test/CommonMarkTestWeak.php || true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7a8ba35f3..000000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: php - -dist: trusty -sudo: false - -matrix: - include: - - php: 5.3 - dist: precise - - php: 5.4 - - php: 5.5 - - php: 5.6 - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: nightly - fast_finish: true - allow_failures: - - php: nightly - -install: - - composer install --prefer-dist --no-interaction --no-progress - -script: - - vendor/bin/phpunit - - vendor/bin/phpunit test/CommonMarkTestWeak.php || true - - '[ -z "$TRAVIS_TAG" ] || [ "$TRAVIS_TAG" == "$(php -r "require(\"Parsedown.php\"); echo Parsedown::version;")" ]' diff --git a/test/CommonMarkTestStrict.php b/test/CommonMarkTestStrict.php index 3837738cb..9a007e234 100644 --- a/test/CommonMarkTestStrict.php +++ b/test/CommonMarkTestStrict.php @@ -1,11 +1,13 @@ Date: Wed, 17 Jul 2024 05:52:46 +0200 Subject: [PATCH 5/8] fix GitHub Actions config file syntax --- .github/workflows/unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index ba7a80b9b..c00148dfd 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - include: + php: - '7.1' - '7.2' - '7.3' From e7a3bccbae1c88f3ee3c57e08b169d7665f5a1ab Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 17 Jul 2024 05:59:36 +0200 Subject: [PATCH 6/8] add a branch alias to allow installing untagged 1.8 versions --- composer.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composer.json b/composer.json index b145680a2..f004cc24e 100644 --- a/composer.json +++ b/composer.json @@ -29,5 +29,10 @@ "CommonMarkTest": "test/", "CommonMarkTestWeak": "test/" } + }, + "extra": { + "branch-alias": { + "dev-1.8.x-beta": "1.8.x-dev" + } } } From 9b14567c57fcb0f466ab086ea9a69dd8e11fbbc8 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 28 Aug 2024 11:18:17 +0300 Subject: [PATCH 7/8] Fix commonmark test --- .gitignore | 1 + test/CommonMarkTestStrict.php | 2 +- test/CommonMarkTestWeak.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d8a7996ab..47342dc5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ composer.lock vendor/ +.phpunit.result.cache diff --git a/test/CommonMarkTestStrict.php b/test/CommonMarkTestStrict.php index 9a007e234..4aa26dcfb 100644 --- a/test/CommonMarkTestStrict.php +++ b/test/CommonMarkTestStrict.php @@ -13,7 +13,7 @@ class CommonMarkTestStrict extends TestCase protected $parsedown; - protected function setUp() + protected function setUp() : void { $this->parsedown = new TestParsedown(); $this->parsedown->setUrlsLinked(false); diff --git a/test/CommonMarkTestWeak.php b/test/CommonMarkTestWeak.php index ef4081aa1..8d0bb4ab2 100644 --- a/test/CommonMarkTestWeak.php +++ b/test/CommonMarkTestWeak.php @@ -17,7 +17,7 @@ class CommonMarkTestWeak extends CommonMarkTestStrict { protected $textLevelElementRegex; - protected function setUp() + protected function setUp() : void { parent::setUp(); From cfb313fb1f3fc3f42a77f8532b6f0f065eb5c9e5 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Wed, 28 Aug 2024 11:19:02 +0300 Subject: [PATCH 8/8] Revert "Merge pull request #876 from xabbuh/branch-alias" This reverts commit 0476f3be5be7090fe4a2d9faf6e5e67f70deb82e, reversing changes made to 9d00deadcda8bb02195b50efbd108544e61779ed. --- composer.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/composer.json b/composer.json index f004cc24e..b145680a2 100644 --- a/composer.json +++ b/composer.json @@ -29,10 +29,5 @@ "CommonMarkTest": "test/", "CommonMarkTestWeak": "test/" } - }, - "extra": { - "branch-alias": { - "dev-1.8.x-beta": "1.8.x-dev" - } } }