mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
parent
23f705d556
commit
24a2208625
1 changed files with 8 additions and 1 deletions
|
@ -332,7 +332,14 @@ Post = ghostBookshelf.Model.extend({
|
||||||
|
|
||||||
// render mobiledoc to HTML
|
// render mobiledoc to HTML
|
||||||
if (this.hasChanged('mobiledoc') || !this.get('html')) {
|
if (this.hasChanged('mobiledoc') || !this.get('html')) {
|
||||||
this.set('html', converters.mobiledocConverter.render(JSON.parse(this.get('mobiledoc'))));
|
try {
|
||||||
|
this.set('html', converters.mobiledocConverter.render(JSON.parse(this.get('mobiledoc'))));
|
||||||
|
} catch (err) {
|
||||||
|
throw new common.errors.ValidationError({
|
||||||
|
message: 'Invalid mobiledoc structure.',
|
||||||
|
help: 'https://docs.ghost.org/concepts/posts/'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.hasChanged('html') || !this.get('plaintext')) {
|
if (this.hasChanged('html') || !this.get('plaintext')) {
|
||||||
|
|
Loading…
Reference in a new issue