mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
🐛 Fixed snippet insertion in the new editor (#17003)
refs TryGhost/Team#3445 - The snippet model always expects an object as it gets serialized when saving - if we give it a string, it gets doubly serialized. It breaks snippet replacement and insertion in the new editor.
This commit is contained in:
parent
6a9d01c6ad
commit
9f1279b58e
1 changed files with 1 additions and 1 deletions
|
@ -392,7 +392,7 @@ export default class LexicalEditorController extends Controller {
|
|||
const existingSnippet = this.snippets.find(snippet => snippet.name.toLowerCase() === snippetNameLC);
|
||||
|
||||
if (existingSnippet) {
|
||||
await this.confirmUpdateSnippet(existingSnippet, {lexical: data.value});
|
||||
await this.confirmUpdateSnippet(existingSnippet, {lexical: JSON.parse(data.value)});
|
||||
} else {
|
||||
await this.saveNewSnippet(data);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue