From 73046626ddfd1cd23d0d4bdd904d1a7bae76c455 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 13 Jul 2023 14:21:27 +0200 Subject: [PATCH] Visual: allow paragraph split inside annotations. --- src/redakcja/static/css/html.scss | 1 + src/redakcja/static/js/wiki/caret.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/redakcja/static/css/html.scss b/src/redakcja/static/css/html.scss index 881083a6..d9886d4f 100644 --- a/src/redakcja/static/css/html.scss +++ b/src/redakcja/static/css/html.scss @@ -327,6 +327,7 @@ div[x-node] > .uwaga { &.editing { display: block; + background: #93ff93; } } diff --git a/src/redakcja/static/js/wiki/caret.js b/src/redakcja/static/js/wiki/caret.js index b2cf1826..38848b09 100644 --- a/src/redakcja/static/js/wiki/caret.js +++ b/src/redakcja/static/js/wiki/caret.js @@ -151,10 +151,21 @@ class Caret { splitBlock() { let splitter = this.element; let parent, newParent, splitIndex, index; - + while (!splitter.is('div[x-node]')) { parent = splitter.parent(); splitIndex = parent.contents().index(splitter); + + if (parent.is('[x-annotation-box]')) { + // We're splitting inside an inline-style annotation. + // Convert into a block-style annotation now. + let p = $('
'); + parent.contents().appendTo(p); + parent.empty(); + parent.append(p); + parent = p; + } + newParent = parent.clone(); index = parent.contents().length - 1; while (index >= splitIndex) { -- 2.20.1