Skip to content

Commit

Permalink
keep pandoc as dev dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
renanbr committed Aug 21, 2023
1 parent db5ac97 commit b4e5473
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
- name: Install Composer dependencies
uses: ramsey/composer-install@v2

- name: Install Pandoc wrapper
run: composer require ueberdosis/pandoc

- name: Cache PHPStan
uses: actions/cache@v2
with:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ jobs:
fail-fast: false
matrix:
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
pandoc-wrapper: ['ryakad/pandoc-php']
include:
- php-version: '8.0'
coverage: true
- php-version: '8.2'
pandoc-wrapper: 'ueberdosis/pandoc'
with-ueberdosis-pandoc: true

steps:

Expand All @@ -43,7 +42,10 @@ jobs:
uses: ramsey/composer-install@v2

- name: Install Pandoc wrapper
run: composer require ${{ matrix.pandoc-wrapper }}
if: ${{ matrix.with-ueberdosis-pandoc }}
run: |
composer remove ryakad/pandoc-php
composer require ueberdosis/pandoc
- name: Run PHPUnit
run: vendor/bin/phpunit --testdox ${{ matrix.coverage && '--coverage-clover ./coverage.xml' || '--no-coverage' }}
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"php": ">=5.6.0"
},
"require-dev": {
"phpunit/phpunit": ">=5.7"
"phpunit/phpunit": ">=5.7",
"ryakad/pandoc-php": "^1.0"
},
"suggest": {
"ryakad/pandoc-php": "Needed to support LaTeX decoder in class RenanBr\\BibTexParser\\Processor\\LatexToUnicodeProcessor",
Expand Down
2 changes: 1 addition & 1 deletion src/Processor/LatexToUnicodeProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private function getConverter()
$pandoc = new Pandoc();

return $this->converter = static function ($text) use ($pandoc) {
// @phpstan-ignore-next-line
return mb_substr($pandoc->input($text)->execute([
'--from', 'latex',
'--to', 'plain',
Expand All @@ -90,7 +91,6 @@ private function getConverter()
$pandoc = new Pandoc();

return $this->converter = static function ($text) use ($pandoc) {
// @phpstan-ignore-next-line
return $pandoc->runWith($text, [
'from' => 'latex',
'to' => 'plain',
Expand Down

0 comments on commit b4e5473

Please sign in to comment.