Skip to content

Commit

Permalink
update class-parser.php
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Apr 18, 2024
1 parent 17316a1 commit b75251f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions vendor/afragen/wordpress-plugin-readme-parser/class-parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,13 @@ protected function parse_readme_contents( $contents ) {
$this->tags = array_filter( $this->tags );

if ( array_intersect( $this->tags, $this->ignore_tags ) ) {
$this->tags = array_diff( $this->tags, $this->ignore_tags );
$this->warnings['ignored_tags'] = true;
$this->warnings['ignored_tags'] = array_intersect( $this->tags, $this->ignore_tags );
$this->tags = array_diff( $this->tags, $this->ignore_tags );
}

if ( count( $this->tags ) > 5 ) {
$this->warnings['too_many_tags'] = array_slice( $this->tags, 4 );
$this->tags = array_slice( $this->tags, 0, 5 );
$this->warnings['too_many_tags'] = array_slice( $this->tags, 5 );
$this->tags = array_slice( $this->tags, 0, 5 );
}
}
if ( ! empty( $headers['requires'] ) ) {
Expand Down Expand Up @@ -554,7 +554,12 @@ protected function trim_length( $desc, $length = 150, $type = 'char' ) {

if ( 'words' === $type ) {
// Split by whitespace, capturing it so we can put it back together.
$pieces = preg_split( '/(\s+)/u', $desc, -1, PREG_SPLIT_DELIM_CAPTURE );
$pieces = @preg_split( '/(\s+)/u', $desc, -1, PREG_SPLIT_DELIM_CAPTURE );

// In the event of an error (Likely invalid UTF8 data), perform the same split, this time in a non-UTF8 safe manner, as a fallback.
if ( $pieces === false ) {
$pieces = preg_split( '/(\s+)/', $desc, -1, PREG_SPLIT_DELIM_CAPTURE );
}

$word_count_with_spaces = $length * 2;

Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@
"source": {
"type": "git",
"url": "https://github.com/afragen/wordpress-plugin-readme-parser.git",
"reference": "018298cb4e5c78a43d43e82de20c89a6bd10556b"
"reference": "a3b49da55b77137399fe13e812b430d702551b8f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/afragen/wordpress-plugin-readme-parser/zipball/018298cb4e5c78a43d43e82de20c89a6bd10556b",
"reference": "018298cb4e5c78a43d43e82de20c89a6bd10556b",
"url": "https://api.github.com/repos/afragen/wordpress-plugin-readme-parser/zipball/a3b49da55b77137399fe13e812b430d702551b8f",
"reference": "a3b49da55b77137399fe13e812b430d702551b8f",
"shasum": ""
},
"require": {
"erusev/parsedown": "^1.7",
"php": ">=5.4"
},
"time": "2024-04-03T15:04:20+00:00",
"time": "2024-04-15T15:05:48+00:00",
"default-branch": true,
"type": "library",
"installation-source": "dist",
Expand Down
6 changes: 3 additions & 3 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => 'afragen/git-updater',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => 'b4e7c25a590e0c80a96babd73741f2b31a7af67f',
'reference' => '17316a1ff8ee71f36761b76110d565e9ee6fb31c',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'afragen/git-updater' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => 'b4e7c25a590e0c80a96babd73741f2b31a7af67f',
'reference' => '17316a1ff8ee71f36761b76110d565e9ee6fb31c',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -33,7 +33,7 @@
'afragen/wordpress-plugin-readme-parser' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '018298cb4e5c78a43d43e82de20c89a6bd10556b',
'reference' => 'a3b49da55b77137399fe13e812b430d702551b8f',
'type' => 'library',
'install_path' => __DIR__ . '/../afragen/wordpress-plugin-readme-parser',
'aliases' => array(
Expand Down

0 comments on commit b75251f

Please sign in to comment.