getgrav / getgrav/grav-plugin-shortcode-core
Can't add assets after update
- Dominant language
- PHP
- Stars
- 47
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
Recently I updated both Grav (`v1.7.33`) and shortcode-core (`v5.1.1`). Since then a third party plugin stopped working.
It seems that shortcode-core doesn't load assets at all. On a clean plugin sample (using the `[strike]` shortcode from shortcode-core main page) I successfully get the formatted string (with ``) but trying to add assets (either `js` or `css`) doesn't seem to work.
The code is really simple:
```
public function init()
{
$this->shortcode->getHandlers()->add('strike', function(ShortcodeInterface $sc) {
$this->shortcode->addAssets('js', 'plugin://test-plugin/js/alert.js');
$this->shortcode->addAssets('inlinejs', 'alert("-");');
$this->shortcode->addAssets('inlinejs', 'console.log("-");');
$this->shortcode->addAssets('css', 'plugin://test-plugin/css/helloworld.css');
return ''.$sc->getContent().'';
});
}
```
Only the `` part gets successfully added and rendered.
Am I doing something wrong?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.