getgrav / getgrav/grav-plugin-shortcode-core

Can't add assets after update

Open
#117 4 comments 0 reactions 1 assignee Claimed by @rhukster View on GitHub
cannot replicate
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.