diff --git a/app/assets/stylesheets/editor.scss b/app/assets/stylesheets/editor.scss index 88c749f..c7b50db 100644 --- a/app/assets/stylesheets/editor.scss +++ b/app/assets/stylesheets/editor.scss @@ -60,7 +60,7 @@ .editor-content { min-height: 480px; - p, h1, h2, h3, h4, h5, h6, ul, li { outline: #ccc solid thin; } + p, h1, h2, h3, h4, h5, h6, ul, li, figcaption { outline: #ccc solid thin; } strong, em, del, u, sub, sup { background: #0002; } a { background: #13fefe50; } [data-editor-selected] { outline: #f206f9 solid thick; } diff --git a/app/javascript/editor/editor.ts b/app/javascript/editor/editor.ts index f560b7e..d660e9e 100644 --- a/app/javascript/editor/editor.ts +++ b/app/javascript/editor/editor.ts @@ -5,6 +5,10 @@ import { setupButtons as setupMarksButtons } from 'editor/types/marks' import { setupButtons as setupBlocksButtons } from 'editor/types/blocks' import { setupButtons as setupParentBlocksButtons } from 'editor/types/parentBlocks' import { setupAuxiliaryToolbar as setupLinkAuxiliaryToolbar } from 'editor/types/link' +import { + setupAuxiliaryToolbar as setupMultimediaAuxiliaryToolbar, + setupButtons as setupMultimediaButtons, +} from 'editor/types/multimedia' import { setupAuxiliaryToolbar as setupMarkAuxiliaryToolbar } from 'editor/types/mark' // Esta funcion corrije errores que pueden haber como: @@ -39,25 +43,27 @@ function fixContent (editor: Editor, node: Element = editor.contentEl): void { const { typeName, type } = _type - const sel = safeGetSelection(editor) - const range = sel && safeGetRangeAt(sel) + if (type.allowedChildren !== 'ignore-children') { + const sel = safeGetSelection(editor) + const range = sel && safeGetRangeAt(sel) - if (getValidChildren(node, type).length == 0) { - if (typeof type.handleEmpty !== 'string') { - const el = type.handleEmpty.create(editor) - // mover cosas que pueden haber - // por ejemplo: cuando convertís a un