diff options
Diffstat (limited to 'app/assets/javascripts/content_editor/extensions/image.js')
-rw-r--r-- | app/assets/javascripts/content_editor/extensions/image.js | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/app/assets/javascripts/content_editor/extensions/image.js b/app/assets/javascripts/content_editor/extensions/image.js index 4dd8a1376ad..6051098d776 100644 --- a/app/assets/javascripts/content_editor/extensions/image.js +++ b/app/assets/javascripts/content_editor/extensions/image.js @@ -48,11 +48,12 @@ const handleFileEvent = ({ editor, file, uploadsPath, renderMarkdown }) => { return false; }; -const ExtendedImage = Image.extend({ +export default Image.extend({ defaultOptions: { ...Image.options, uploadsPath: null, renderMarkdown: null, + inline: true, }, addAttributes() { return { @@ -152,17 +153,3 @@ const ExtendedImage = Image.extend({ return VueNodeViewRenderer(ImageWrapper); }, }); - -const serializer = (state, node) => { - const { alt, canonicalSrc, src, title } = node.attrs; - const quotedTitle = title ? ` ${state.quote(title)}` : ''; - - state.write(`![${state.esc(alt || '')}](${state.esc(canonicalSrc || src)}${quotedTitle})`); -}; - -export const configure = ({ renderMarkdown, uploadsPath }) => { - return { - tiptapExtension: ExtendedImage.configure({ inline: true, renderMarkdown, uploadsPath }), - serializer, - }; -}; |