From 6f5c2a95572b1e6360fe62d10fb4778b6fa40cdc Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 26 Mar 2020 14:27:41 +0000 Subject: [PATCH] Switched to explicit mobiledoc version for new posts no issue - when the mobiledoc spec changes due to a mobiledoc-kit version bump, any posts created with that version will fail to load in the editor if a rollback to an earlier Ghost version occurs - use an explicit version to avoid the problem - we should only be bumping the mobiledoc spec version if we start using features from that version and mark it as a breaking change --- .../koenig-editor/addon/components/koenig-basic-html-input.js | 3 +-- .../admin/lib/koenig-editor/addon/components/koenig-editor.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ghost/admin/lib/koenig-editor/addon/components/koenig-basic-html-input.js b/ghost/admin/lib/koenig-editor/addon/components/koenig-basic-html-input.js index 24984f3aec..0a0cd23b03 100644 --- a/ghost/admin/lib/koenig-editor/addon/components/koenig-basic-html-input.js +++ b/ghost/admin/lib/koenig-editor/addon/components/koenig-basic-html-input.js @@ -6,7 +6,6 @@ import parserPlugins from '../options/basic-html-parser-plugins'; import registerKeyCommands, {BASIC_KEY_COMMANDS} from '../options/key-commands'; import validator from 'validator'; import {DRAG_DISABLED_DATA_ATTR} from '../lib/dnd/constants'; -import {MOBILEDOC_VERSION} from 'mobiledoc-kit/renderers/mobiledoc'; import {arrayToMap, toggleSpecialFormatEditState} from './koenig-editor'; import {assign} from '@ember/polyfills'; import {computed} from '@ember/object'; @@ -20,7 +19,7 @@ const UNDO_DEPTH = 50; // blank doc contains a single empty paragraph so that there's some content for // the cursor to start in const BLANK_DOC = { - version: MOBILEDOC_VERSION, + version: '0.3.1', markups: [], atoms: [], cards: [], diff --git a/ghost/admin/lib/koenig-editor/addon/components/koenig-editor.js b/ghost/admin/lib/koenig-editor/addon/components/koenig-editor.js index ad405546e2..9249648010 100644 --- a/ghost/admin/lib/koenig-editor/addon/components/koenig-editor.js +++ b/ghost/admin/lib/koenig-editor/addon/components/koenig-editor.js @@ -18,7 +18,6 @@ import registerKeyCommands from '../options/key-commands'; import registerTextExpansions from '../options/text-expansions'; import validator from 'validator'; import {A} from '@ember/array'; -import {MOBILEDOC_VERSION} from 'mobiledoc-kit/renderers/mobiledoc'; import {assign} from '@ember/polyfills'; import {camelize, capitalize} from '@ember/string'; import {createParserPlugins} from '@tryghost/kg-parser-plugins'; @@ -45,7 +44,7 @@ export const TESTING_EXPANDO_PROPERTY = '__mobiledoc_kit_editor'; // blank doc contains a single empty paragraph so that there's some content for // the cursor to start in export const BLANK_DOC = { - version: MOBILEDOC_VERSION, + version: '0.3.1', markups: [], atoms: [], cards: [],