From 6d8aabab2347feabdd804b609dcd4513f09f78d4 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 11 Feb 2022 09:21:19 +0000 Subject: composer libs minor version updates --- vendor/league/html-to-markdown/CHANGELOG.md | 9 +++++- .../league/html-to-markdown/src/HtmlConverter.php | 32 ++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) (limited to 'vendor/league/html-to-markdown') diff --git a/vendor/league/html-to-markdown/CHANGELOG.md b/vendor/league/html-to-markdown/CHANGELOG.md index 36fb1249e..03c3f6f5c 100644 --- a/vendor/league/html-to-markdown/CHANGELOG.md +++ b/vendor/league/html-to-markdown/CHANGELOG.md @@ -4,6 +4,12 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ## [Unreleased][unreleased] +## [5.0.2] - 2021-11-06 + +### Fixed + + - Fixed missplaced comment nodes appearing at the start of the HTML input (#212) + ## [5.0.1] - 2021-09-17 ### Fixed @@ -299,7 +305,8 @@ not ideally set, so this releases fixes that. Moving forwards this should reduce ### Added - Initial release -[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/5.0.1...master +[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/5.0.2...master +[5.0.2]: https://github.com/thephpleague/html-to-markdown/compare/5.0.1...5.0.2 [5.0.1]: https://github.com/thephpleague/html-to-markdown/compare/5.0.0...5.0.1 [5.0.0]: https://github.com/thephpleague/html-to-markdown/compare/4.10.0...5.0.0 [4.10.0]: https://github.com/thephpleague/html-to-markdown/compare/4.9.1...4.10.0 diff --git a/vendor/league/html-to-markdown/src/HtmlConverter.php b/vendor/league/html-to-markdown/src/HtmlConverter.php index 7cd543b34..7162b256d 100644 --- a/vendor/league/html-to-markdown/src/HtmlConverter.php +++ b/vendor/league/html-to-markdown/src/HtmlConverter.php @@ -121,6 +121,8 @@ class HtmlConverter implements HtmlConverterInterface $document->loadHTML('' . $html); $document->encoding = 'UTF-8'; + $this->replaceMisplacedComments($document); + if ($this->getConfig()->getOption('suppress_errors')) { \libxml_clear_errors(); } @@ -128,6 +130,36 @@ class HtmlConverter implements HtmlConverterInterface return $document; } + /** + * Finds any comment nodes outside element and moves them into . + * + * @see https://github.com/thephpleague/html-to-markdown/issues/212 + * @see https://3v4l.org/7bC33 + */ + private function replaceMisplacedComments(\DOMDocument $document): void + { + // Find ny comment nodes at the root of the document. + $misplacedComments = (new \DOMXPath($document))->query('/comment()'); + if ($misplacedComments === false) { + return; + } + + $body = $document->getElementsByTagName('body')->item(0); + if ($body === null) { + return; + } + + // Loop over comment nodes in reverse so we put them inside in + // their original order. + for ($index = $misplacedComments->length - 1; $index >= 0; $index--) { + if ($body->firstChild === null) { + $body->insertBefore($misplacedComments[$index]); + } else { + $body->insertBefore($misplacedComments[$index], $body->firstChild); + } + } + } + /** * Convert Children * -- cgit v1.2.3 From 5468de2c6ad5187cd51201cda929c3e54cc2938f Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 11 Feb 2022 09:23:29 +0000 Subject: composer libs minor version updates add new files --- .../.github/ISSUE_TEMPLATE/1_Conversion_error.yaml | 25 +++++++++++++ .../.github/ISSUE_TEMPLATE/2_Bug_report.yaml | 43 ++++++++++++++++++++++ .../.github/ISSUE_TEMPLATE/3_Feature_request.yaml | 27 ++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 vendor/league/html-to-markdown/.github/ISSUE_TEMPLATE/1_Conversion_error.yaml create mode 100644 vendor/league/html-to-markdown/.github/ISSUE_TEMPLATE/2_Bug_report.yaml create mode 100644 vendor/league/html-to-markdown/.github/ISSUE_TEMPLATE/3_Feature_request.yaml (limited to 'vendor/league/html-to-markdown') diff --git a/vendor/league/html-to-markdown/.github/ISSUE_TEMPLATE/1_Conversion_error.yaml b/vendor/league/html-to-markdown/.github/ISSUE_TEMPLATE/1_Conversion_error.yaml new file mode 100644 index 000000000..7f267b208 --- /dev/null +++ b/vendor/league/html-to-markdown/.github/ISSUE_TEMPLATE/1_Conversion_error.yaml @@ -0,0 +1,25 @@ +name: "📃 Bug Report (Incorrect Markdown)" +description: I'm not getting the Markdown I expect +body: + - type: input + id: affected-versions + attributes: + label: Version(s) affected + placeholder: x.y.z + validations: + required: true + - type: textarea + id: description + attributes: + label: Description + description: A clear and concise description of the problem. + validations: + required: true + - type: textarea + id: how-to-reproduce + attributes: + label: How to reproduce + description: | + Provide the HTML input and any other information that would help us reproduce the problem. + validations: + required: true diff --git a/vendor/league/html-to-markdown/.github/ISSUE_TEMPLATE/2_Bug_report.yaml b/vendor/league/html-to-markdown/.github/ISSUE_TEMPLATE/2_Bug_report.yaml new file mode 100644 index 000000000..2045fb79a --- /dev/null +++ b/vendor/league/html-to-markdown/.github/ISSUE_TEMPLATE/2_Bug_report.yaml @@ -0,0 +1,43 @@ +name: "🐛 Bug Report (Other)" +description: Report all other errors and problems +body: + - type: input + id: affected-versions + attributes: + label: Version(s) affected + placeholder: x.y.z + validations: + required: true + - type: textarea + id: description + attributes: + label: Description + description: A clear and concise description of the problem. + validations: + required: true + - type: textarea + id: how-to-reproduce + attributes: + label: How to reproduce + description: | + HTML and/or any other information needed to reproduce the problem. + validations: + required: true + - type: textarea + id: possible-solution + attributes: + label: Possible solution + description: | + Optional: only if you have suggestions on a fix/reason for the bug + - type: textarea + id: additional-context + attributes: + label: Additional context + description: | + Optional: any other context about the problem: log messages, screenshots, etc. + - type: textarea + id: feedback + attributes: + label: Did this project help you today? Did it make you happy in any way? + description: | + Optional: Sometimes we get tired of reading bug reports and working on complex features, so if you have anything positive to share about how this library might have helped you we'd love to hear it! diff --git a/vendor/league/html-to-markdown/.github/ISSUE_TEMPLATE/3_Feature_request.yaml b/vendor/league/html-to-markdown/.github/ISSUE_TEMPLATE/3_Feature_request.yaml new file mode 100644 index 000000000..2d91a58d0 --- /dev/null +++ b/vendor/league/html-to-markdown/.github/ISSUE_TEMPLATE/3_Feature_request.yaml @@ -0,0 +1,27 @@ +name: "🚀 Feature Request" +description: RFC and ideas for new features and improvements +labels: + - enhancement +body: + - type: textarea + id: description + attributes: + label: Description + description: A clear and concise description of the problem. + validations: + required: true + - type: textarea + id: example + attributes: + label: Example + description: | + A simple example of the new feature in action (include PHP code, sample HTML/Markdown, etc.) + If the new feature changes an existing feature, include a simple before/after comparison. + validations: + required: true + - type: textarea + id: feedback + attributes: + label: Did this project help you today? Did it make you happy in any way? + description: | + Optional: Sometimes we get tired of reading bug reports and working on complex features, so if you have anything positive to share about how this library might have helped you we'd love to hear it! -- cgit v1.2.3 From 34f64148e8c936ac1189be937329ebe708e942b6 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 2 Mar 2022 19:52:47 +0000 Subject: composer updates --- vendor/league/html-to-markdown/CHANGELOG.md | 13 ++++++++++++- vendor/league/html-to-markdown/composer.json | 11 ++++++++--- vendor/league/html-to-markdown/psalm.xml | 1 - .../src/Converter/HorizontalRuleConverter.php | 2 +- vendor/league/html-to-markdown/src/Element.php | 2 +- 5 files changed, 22 insertions(+), 7 deletions(-) (limited to 'vendor/league/html-to-markdown') diff --git a/vendor/league/html-to-markdown/CHANGELOG.md b/vendor/league/html-to-markdown/CHANGELOG.md index 03c3f6f5c..60e8e6f24 100644 --- a/vendor/league/html-to-markdown/CHANGELOG.md +++ b/vendor/league/html-to-markdown/CHANGELOG.md @@ -4,6 +4,16 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ## [Unreleased][unreleased] +## [5.1.0] - 2022-03-02 + +### Changed + + - Changed horizontal rule style (#218, #219) + +### Fixed + + - Fixed `Element::getValue()` not handling possible nulls + ## [5.0.2] - 2021-11-06 ### Fixed @@ -305,7 +315,8 @@ not ideally set, so this releases fixes that. Moving forwards this should reduce ### Added - Initial release -[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/5.0.2...master +[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/5.1.0...master +[5.1.0]: https://github.com/thephpleague/html-to-markdown/compare/5.0.2...5.1.0 [5.0.2]: https://github.com/thephpleague/html-to-markdown/compare/5.0.1...5.0.2 [5.0.1]: https://github.com/thephpleague/html-to-markdown/compare/5.0.0...5.0.1 [5.0.0]: https://github.com/thephpleague/html-to-markdown/compare/4.10.0...5.0.0 diff --git a/vendor/league/html-to-markdown/composer.json b/vendor/league/html-to-markdown/composer.json index af3e41058..22ca054f3 100644 --- a/vendor/league/html-to-markdown/composer.json +++ b/vendor/league/html-to-markdown/composer.json @@ -36,16 +36,21 @@ }, "require-dev": { "mikehaertl/php-shellcommand": "^1.1.0", - "phpstan/phpstan": "^0.12.82", + "phpstan/phpstan": "^0.12.99", "phpunit/phpunit": "^8.5 || ^9.2", "scrutinizer/ocular": "^1.6", "unleashedtech/php-coding-standard": "^2.7", - "vimeo/psalm": "^4.6" + "vimeo/psalm": "^4.22" }, "bin": ["bin/html-to-markdown"], "extra": { "branch-alias": { - "dev-master": "5.1-dev" + "dev-master": "5.2-dev" + } + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true } } } diff --git a/vendor/league/html-to-markdown/psalm.xml b/vendor/league/html-to-markdown/psalm.xml index 729e9a919..30258a709 100644 --- a/vendor/league/html-to-markdown/psalm.xml +++ b/vendor/league/html-to-markdown/psalm.xml @@ -1,6 +1,5 @@ node->nodeValue; + return $this->node->nodeValue ?? ''; } public function hasParent(): bool -- cgit v1.2.3