mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
parent
23f705d556
commit
24a2208625
@ -332,7 +332,14 @@ Post = ghostBookshelf.Model.extend({
|
||||
|
||||
// render mobiledoc to 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')) {
|
||||
|
Loading…
Reference in New Issue
Block a user