Skip to content

Commit 3c90115

Browse files
committed
Merge branch 'release/5.0.7'
2 parents 01ae018 + dc15d36 commit 3c90115

File tree

11 files changed

+706
-376
lines changed

11 files changed

+706
-376
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# v5.0.7
2+
## 09/28/2021
3+
4+
1. [](#bugfix)
5+
* NextGen Editor: Ensure content of children shortcode elements, such as UI Tab content, have a new empty line as prefix and suffix, to ensure Markdown lists are not lost [getgrav/grav-premium-issues#123](https://github.com/getgrav/grav-premium-issues/issues/123)
6+
2. [](#improved)
7+
* Added `processShortcodesRaw()` using raw_handlers [#104](https://github.com/getgrav/grav-plugin-shortcode-core/pull/104)
8+
* Better vertical alignment for inline shortcodes in NextGen Editor
9+
110
# v5.0.6
211
## 04/27/2021
312

blueprints.yaml

Lines changed: 2 additions & 2 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: 5.0.6
4+
version: 5.0.7
55
description: "This plugin provides the core functionality for shortcode plugins"
66
icon: code
77
author:
@@ -86,7 +86,7 @@ form:
8686

8787
css.notice_enabled:
8888
type: toggle
89-
label: Enbable Notice Shortcode CSS
89+
label: Enable Notice Shortcode CSS
9090
help: Enable the default notice CSS by default. Disable if you want to use your own custom CSS.
9191
highlight: 1
9292
default: 1

classes/plugin/ShortcodeManager.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,16 +283,27 @@ public function processRawContent(PageInterface $page, Data $config)
283283
* For example when used by Twig directly
284284
*
285285
* @param $str
286+
* @param null $handlers
286287
* @return string
287288
*/
288-
public function processShortcodes($str)
289+
public function processShortcodes($str, $handlers = null)
289290
{
290291
$parser = $this->getParser($this->config->get('parser'));
291-
$processor = new Processor(new $parser(new CommonSyntax()), $this->handlers);
292+
293+
if (!$handlers) {
294+
$handlers = $this->handlers;
295+
}
296+
297+
$processor = new Processor(new $parser(new CommonSyntax()), $handlers);
292298

293299
return $processor->process($str);
294300
}
295301

302+
public function processShortcodesRaw($str)
303+
{
304+
return $this->processShortcodes($str, $this->raw_handlers);
305+
}
306+
296307
/**
297308
* set a state of a particular item with a hash for retrieval later
298309
*

nextgen-editor/dist/css/app.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nextgen-editor/dist/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nextgen-editor/dist/js/app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nextgen-editor/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
"lint": "vue-cli-service lint"
1010
},
1111
"devDependencies": {
12-
"@vue/cli-plugin-babel": "~4.5.12",
13-
"@vue/cli-plugin-eslint": "~4.5.12",
14-
"@vue/cli-service": "~4.5.12",
12+
"@vue/cli-plugin-babel": "~4.5.13",
13+
"@vue/cli-plugin-eslint": "~4.5.13",
14+
"@vue/cli-service": "~4.5.13",
1515
"@vue/eslint-config-airbnb": "^5.3.0",
1616
"babel-eslint": "^10.1.0",
1717
"directory-named-webpack-plugin": "^4.0.1",
18-
"eslint": "^7.25.0",
19-
"eslint-plugin-import": "^2.22.1",
20-
"eslint-plugin-vue": "^7.9.0",
21-
"node-sass": "^5.0.0",
22-
"sass-loader": "^11.0.1"
18+
"eslint": "^7.32.0",
19+
"eslint-plugin-import": "^2.24.2",
20+
"eslint-plugin-vue": "^7.18.0",
21+
"node-sass": "^6.0.1",
22+
"sass-loader": "^12.1.0"
2323
}
2424
}

nextgen-editor/src/main.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ shortcode-inline {
234234
display: inline-flex;
235235
margin-left: 2px;
236236
margin-right: 1px;
237+
vertical-align: middle;
237238
}
238239

239240
shortcode-inline-editable,
@@ -244,6 +245,7 @@ shortcode-inline-readonly {
244245

245246
shortcode-inline > .sc-content {
246247
display: inline-flex;
248+
align-items: center;
247249
}
248250

249251
shortcode-inline > .sc-settings {

nextgen-editor/src/postsave.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ window.nextgenEditor.addHook('hookHTMLtoMarkdown', {
6666
content = `\n${content}\n`;
6767
}
6868

69+
if (shortcode.parent) {
70+
content = `\n${content}\n`;
71+
}
72+
6973
output = output.replace(hash, `${groups.opening}${content}${groups.closing}`);
7074
}
7175

0 commit comments

Comments
 (0)