Visual: allow paragraph split inside annotations.
authorRadek Czajka <rczajka@rczajka.pl>
Thu, 13 Jul 2023 12:21:27 +0000 (14:21 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Thu, 13 Jul 2023 12:21:27 +0000 (14:21 +0200)
src/redakcja/static/css/html.scss
src/redakcja/static/js/wiki/caret.js

index 881083a..d9886d4 100644 (file)
@@ -327,6 +327,7 @@ div[x-node] > .uwaga {
 
         &.editing {
             display: block;
 
         &.editing {
             display: block;
+            background: #93ff93;
         }
     }
     
         }
     }
     
index b2cf182..38848b0 100644 (file)
@@ -151,10 +151,21 @@ class Caret {
     splitBlock() {
         let splitter = this.element;
         let parent, newParent, splitIndex, index;
     splitBlock() {
         let splitter = this.element;
         let parent, newParent, splitIndex, index;
-        
+
         while (!splitter.is('div[x-node]')) {
             parent = splitter.parent();
             splitIndex = parent.contents().index(splitter);
         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 = $('<div x-editable="true" x-node="akap">');
+                parent.contents().appendTo(p);
+                parent.empty();
+                parent.append(p);
+                parent = p;
+            }
+
             newParent = parent.clone();
             index = parent.contents().length - 1;
             while (index >= splitIndex) {
             newParent = parent.clone();
             index = parent.contents().length - 1;
             while (index >= splitIndex) {