diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index 443585f..d3c66b7 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -24,7 +24,7 @@ jobs: extensions: mbstring - name: Composer install - uses: ramsey/composer-install@v2 + uses: ramsey/composer-install@v3 - name: Run code standard fixer run: vendor/bin/php-cs-fixer fix --dry-run --diff diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 927a5d5..ff21534 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -23,7 +23,7 @@ jobs: extensions: mbstring - name: Composer install - uses: ramsey/composer-install@v2 + uses: ramsey/composer-install@v3 - name: Run a static analysis with phpstan/phpstan run: vendor/bin/phpstan analyse diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 52f8ed6..d3c27ad 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,6 @@ jobs: strategy: matrix: php-version: - - 7.3 - 7.4 - 8.0 - 8.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index e87085e..c299a54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog ## [Unreleased](https://github.com/akhx/typograf/compare/v0.6.0...HEAD) +* url добавлен в safeBlock ## [0.6.0](https://github.com/akhx/typograf/compare/v0.5.0...v0.6.0) - 2024-09-25 * переработан SafeBlock diff --git a/composer.json b/composer.json index 4307916..036bc2f 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ } }, "require": { - "php": ">=7.3", + "php": ">=7.4", "ext-json": "*", "ext-mbstring": "*" }, @@ -35,7 +35,7 @@ "phpunit/phpunit": "^9.0", "phpunit/php-code-coverage": "^9.2", "friendsofphp/php-cs-fixer": "^3.4", - "phpstan/phpstan": "^1.7" + "phpstan/phpstan": "^2.0" }, "scripts": { "csfixer" : "./vendor/bin/php-cs-fixer fix --dry-run --diff", diff --git a/src/SafeBlock.php b/src/SafeBlock.php index a62497c..7279035 100644 --- a/src/SafeBlock.php +++ b/src/SafeBlock.php @@ -27,6 +27,7 @@ class SafeBlock '//ius', '/\[[a-z]([^]]+)]/ius', '/(.+?)<\/span>/ius', + '/https?:\/\/?([^<\'"[\s]+)/ius', ]; /** diff --git a/tests/TypografTest.php b/tests/TypografTest.php index cf0a373..e80ab11 100644 --- a/tests/TypografTest.php +++ b/tests/TypografTest.php @@ -143,6 +143,9 @@ public function testApplyDocument(): void

"Пример"

+ https://www.domain.com/path/test-05-09-2024/ + https://domain.com/path/test-05-09-2024/ + [embed]https://domain.com/path/test-05-09-2024/[/embed]