Skip to content

Commit 7b59abe

Browse files
committed
Merge branch 'release/6.2.0'
2 parents 36a3b25 + 8719ee2 commit 7b59abe

13 files changed

Lines changed: 132 additions & 107 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# v6.2.0
2+
## 06/24/2026
3+
4+
1. [](#improved)
5+
* Renamed the `TarsParser` added in 6.1.0 to `HybridParser`, a name that better describes how it works: one regex pass lexes every tag, then a stack-based pass resolves nesting. It pairs RegexParser's speed with RegularParser's correctness.
6+
* Made `hybrid` the default parser for new installs and renamed the matching Processor dropdown option in the plugin settings.
7+
* Kept the old `tars` setting working. Sites that selected it keep running unchanged, the value now resolves to `HybridParser` automatically, so no config edits are needed.
8+
19
# v6.1.0
210
## 06/21/2026
311

blueprints.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Shortcode Core
22
slug: shortcode-core
33
type: plugin
4-
version: 6.1.0
4+
version: 6.2.0
55
description: "This plugin provides the core functionality for shortcode plugins"
66
icon: code
77
author:
@@ -84,12 +84,12 @@ form:
8484
size: medium
8585
classes: fancy
8686
label: Processor
87-
help: Which built-in processor to use. Tars (fast and robust), Regular (robust reference), Regex (fast), WordPress (limited)
87+
help: Which built-in processor to use. Hybrid (fast and robust), Regular (robust reference), Regex (fast), WordPress (limited)
8888
options:
89-
tars: TarsParser
90-
wordpress: WordpressParser
91-
regex: RegexParser
89+
hybrid: HybridParser
9290
regular: RegularParser
91+
regex: RegexParser
92+
wordpress: WordpressParser
9393

9494
custom_shortcodes:
9595
type: text

classes/plugin/ShortcodeManager.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use Thunder\Shortcode\HandlerContainer\HandlerContainer;
1111
use Thunder\Shortcode\Parser\RegexParser;
1212
use Thunder\Shortcode\Parser\RegularParser;
13-
use Thunder\Shortcode\Parser\TarsParser;
13+
use Thunder\Shortcode\Parser\HybridParser;
1414
use Thunder\Shortcode\Parser\WordpressParser;
1515
use Thunder\Shortcode\Processor\Processor;
1616
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
@@ -391,14 +391,16 @@ protected function getParser($parser)
391391
case 'regular':
392392
$parser = RegularParser::class;
393393
break;
394-
case 'tars':
395-
$parser = TarsParser::class;
394+
case 'regex':
395+
$parser = RegexParser::class;
396396
break;
397397
case 'wordpress':
398398
$parser = WordpressParser::class;
399399
break;
400+
case 'tars': // legacy alias kept for configs created before the rename to Hybrid
401+
case 'hybrid':
400402
default:
401-
$parser = RegexParser::class;
403+
$parser = HybridParser::class;
402404
break;
403405
}
404406

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
],
2222
"require": {
2323
"php": ">=7.1.3",
24-
"thunderer/shortcode": "dev-feature/tars-parser as 0.7.7"
24+
"thunderer/shortcode": "dev-add-tars-parser as 0.7.7"
2525
},
2626
"autoload": {
2727
"psr-4": {

composer.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shortcode-core.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ enabled: true
22
active: true
33
active_admin: true
44
admin_pages_only: true
5-
parser: tars
5+
parser: hybrid
66
include_default_shortcodes: true
77
css:
88
notice_enabled: true

vendor/composer/installed.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"packages": [
33
{
44
"name": "thunderer/shortcode",
5-
"version": "dev-feature/tars-parser",
6-
"version_normalized": "dev-feature/tars-parser",
5+
"version": "dev-add-tars-parser",
6+
"version_normalized": "dev-add-tars-parser",
77
"source": {
88
"type": "git",
99
"url": "https://github.com/rhukster/Shortcode.git",
10-
"reference": "69024288e7d4074bb04e16940169b65709ced6c6"
10+
"reference": "e4032b4a08ef1011eec2f6f22f25c104923d1fef"
1111
},
1212
"dist": {
1313
"type": "zip",
14-
"url": "https://api.github.com/repos/rhukster/Shortcode/zipball/69024288e7d4074bb04e16940169b65709ced6c6",
15-
"reference": "69024288e7d4074bb04e16940169b65709ced6c6",
14+
"url": "https://api.github.com/repos/rhukster/Shortcode/zipball/e4032b4a08ef1011eec2f6f22f25c104923d1fef",
15+
"reference": "e4032b4a08ef1011eec2f6f22f25c104923d1fef",
1616
"shasum": ""
1717
},
1818
"require": {
@@ -27,7 +27,7 @@
2727
"ext-json": "if you want to use JSON serializer",
2828
"symfony/yaml": "if you want to use YAML serializer"
2929
},
30-
"time": "2026-06-18T14:52:56+00:00",
30+
"time": "2026-06-24T19:42:47+00:00",
3131
"type": "library",
3232
"installation-source": "dist",
3333
"autoload": {
@@ -58,7 +58,7 @@
5858
"shortcode"
5959
],
6060
"support": {
61-
"source": "https://github.com/rhukster/Shortcode/tree/feature/tars-parser"
61+
"source": "https://github.com/rhukster/Shortcode/tree/add-tars-parser"
6262
},
6363
"install-path": "../thunderer/shortcode"
6464
}

vendor/composer/installed.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'name' => 'getgrav/shortcode-core',
44
'pretty_version' => 'dev-develop',
55
'version' => 'dev-develop',
6-
'reference' => 'bfbe3a7e18936bfe6b6d671b5ec49e9dd87eb77f',
6+
'reference' => '267ba040eae1a40a89a2dc88d3c43958309f185b',
77
'type' => 'grav-plugin',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -13,16 +13,16 @@
1313
'getgrav/shortcode-core' => array(
1414
'pretty_version' => 'dev-develop',
1515
'version' => 'dev-develop',
16-
'reference' => 'bfbe3a7e18936bfe6b6d671b5ec49e9dd87eb77f',
16+
'reference' => '267ba040eae1a40a89a2dc88d3c43958309f185b',
1717
'type' => 'grav-plugin',
1818
'install_path' => __DIR__ . '/../../',
1919
'aliases' => array(),
2020
'dev_requirement' => false,
2121
),
2222
'thunderer/shortcode' => array(
23-
'pretty_version' => 'dev-feature/tars-parser',
24-
'version' => 'dev-feature/tars-parser',
25-
'reference' => '69024288e7d4074bb04e16940169b65709ced6c6',
23+
'pretty_version' => 'dev-add-tars-parser',
24+
'version' => 'dev-add-tars-parser',
25+
'reference' => 'e4032b4a08ef1011eec2f6f22f25c104923d1fef',
2626
'type' => 'library',
2727
'install_path' => __DIR__ . '/../thunderer/shortcode',
2828
'aliases' => array(

vendor/thunderer/shortcode/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ This section discusses available shortcode parsers. Regardless of the parser tha
203203
There are four included parsers in this library:
204204

205205
- `RegularParser` is the most powerful and correct parser available in this library. It contains the actual parser designed to handle all the issues with shortcodes like proper nesting or detecting invalid shortcode syntax. It is slightly slower than regex-based parser described below,
206-
- `TarsParser` produces exactly the same result as `RegularParser`, including proper nesting and invalid syntax detection, but it lexes every tag in a single regular expression pass and resolves nesting with a flat stack instead of a recursive token parser. This makes it several times faster than `RegularParser` and much lighter on memory, since it never builds a token array for the whole input. It is a good choice when you want `RegularParser`'s correctness without its cost,
206+
- `HybridParser` produces exactly the same result as `RegularParser`, including proper nesting and invalid syntax detection, but it lexes every tag in a single regular expression pass and resolves nesting with a flat stack instead of a recursive token parser. This makes it several times faster than `RegularParser` and much lighter on memory, since it never builds a token array for the whole input. It is a good choice when you want `RegularParser`'s correctness without its cost,
207207
- `RegexParser` uses a handcrafted regular expression dedicated to handle shortcode syntax as much as regex engine allows. It is fastest among the parsers included in this library, but it can't handle nesting properly, which means that nested shortcodes with the same name are also considered overlapping - (assume that shortcode `[c]` returns its content) string `[c]x[c]y[/c]z[/c]` will be interpreted as `xyz[/c]` (first closing tag was matched to first opening tag). This can be solved by aliasing handler name, because for example `[c]x[d]y[/d]z[/c]` will be processed correctly,
208208
- `WordpressParser` contains code copied from the latest currently available WordPress (4.3.1). It is also a regex-based parser, but the included regular expression is quite weak, it for example won't support BBCode syntax (`[name="param" /]`). This parser by default supports the shortcode name rule, but can break it when created with one of the named constructors (`createFromHandlers()` or `createFromNames()`) that change its behavior to catch only configured names. All of it is intentional to keep the compatibility with what WordPress is capable of if you need that compatibility.
209209

0 commit comments

Comments
 (0)