Skip to content

Commit

Permalink
Upgrade to latest shortcode lib to address several bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Feb 4, 2019
1 parent 2e4a7f1 commit f1359f3
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v3.0.1
## 02/03/2019

1. [](#bugfix)
* Fixed issues with `0` param and `regular` parser [#14](https://github.com/getgrav/grav-plugin-shortcode-core/issues/14) [#57](https://github.com/getgrav/grav-plugin-shortcode-core/issues/57) [shortcode-ui#29](https://github.com/getgrav/grav-plugin-shortcode-ui/issues/29) [shortcode-ui#6](https://github.com/getgrav/grav-plugin-shortcode-ui/issues/26)

# v3.0.0
## 12/19/2018

Expand Down
10 changes: 5 additions & 5 deletions composer.lock

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

2 changes: 1 addition & 1 deletion shortcode-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ enabled: true
active: true
active_admin: true
admin_pages_only: true
parser: regular
parser: wordpress
custom_shortcodes:
fontawesome:
load: true
Expand Down
12 changes: 6 additions & 6 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[
{
"name": "thunderer/shortcode",
"version": "v0.7.0",
"version_normalized": "0.7.0.0",
"version": "v0.7.1",
"version_normalized": "0.7.1.0",
"source": {
"type": "git",
"url": "https://github.com/thunderer/Shortcode.git",
"reference": "ccf16e8ebc8a8beab613356a76aca5f44a62cc75"
"reference": "8f3a65f35de7f03e8c4a50e490c490888dc5b722"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thunderer/Shortcode/zipball/ccf16e8ebc8a8beab613356a76aca5f44a62cc75",
"reference": "ccf16e8ebc8a8beab613356a76aca5f44a62cc75",
"url": "https://api.github.com/repos/thunderer/Shortcode/zipball/8f3a65f35de7f03e8c4a50e490c490888dc5b722",
"reference": "8f3a65f35de7f03e8c4a50e490c490888dc5b722",
"shasum": ""
},
"require": {
Expand All @@ -26,7 +26,7 @@
"ext-json": "if you want to use JSON serializer",
"symfony/yaml": "if you want to use YAML serializer"
},
"time": "2018-12-09T23:07:21+00:00",
"time": "2019-02-03T22:50:59+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions vendor/thunderer/shortcode/src/Parser/RegularParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ private function value()
return $this->match(self::TOKEN_DELIMITER, false) ? $value : false;
}

if($tmp = $this->match(self::TOKEN_STRING, false)) {
if('' !== $tmp = $this->match(self::TOKEN_STRING, false)) {
$value .= $tmp;
while($tmp = $this->match(self::TOKEN_STRING, false)) {
while('' !== $tmp = $this->match(self::TOKEN_STRING, false)) {
$value .= $tmp;
}

Expand Down
6 changes: 5 additions & 1 deletion vendor/thunderer/shortcode/tests/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ public function provideShortcodes()
new ParsedShortcode(new Shortcode('y', array(), ' ] [] [ [z] [/#] [/z] [ [] ] [/] ', null), '[y] ] [] [ [z] [/#] [/z] [ [] ] [/] [/y]', 27),
new ParsedShortcode(new Shortcode('z', array(), ' [ [/ [/] /] ] ', null), '[z] [ [/ [/] /] ] [/z]', 70),
)),
// falsy string values
array($s, '[a=0 b=0]0[/a]', array(
new ParsedShortcode(new Shortcode('a', array('b' => '0'), '0', '0'), '[a=0 b=0]0[/a]', 0),
)),
);

/**
Expand All @@ -239,7 +243,7 @@ public function provideShortcodes()
*
* Tests cases from array above with identifiers in the array below must be skipped.
*/
$wordpressSkip = array(3, 6, 16, 21, 22, 23, 25, 32, 33, 34, 46, 47, 49);
$wordpressSkip = array(3, 6, 16, 21, 22, 23, 25, 32, 33, 34, 46, 47, 49, 51);
$result = array();
foreach($tests as $key => $test) {
$syntax = array_shift($test);
Expand Down

0 comments on commit f1359f3

Please sign in to comment.