X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/d86195c3b7dc2726a9eff10fdb2b9f5190ca15fe..8da57c41af2d69702bbc23c7a64adc6f102d2bcd:/src/redakcja/static/js/wiki/view_editor_wysiwyg.js

diff --git a/src/redakcja/static/js/wiki/view_editor_wysiwyg.js b/src/redakcja/static/js/wiki/view_editor_wysiwyg.js
index 2e1c28d2..3d4ca02c 100644
--- a/src/redakcja/static/js/wiki/view_editor_wysiwyg.js
+++ b/src/redakcja/static/js/wiki/view_editor_wysiwyg.js
@@ -110,7 +110,7 @@
             success: function(text){
                 var t = $(text);
                 tag.replaceWith(t);
-                openForEdit(t);
+                openForEdit(t, trim=false);
             },
             error: function(){
                 tag.remove();
@@ -405,7 +405,7 @@
     }
 
     /* open edition window for selected fragment */
-    function openForEdit($origin){
+    function openForEdit($origin, trim=true){
         var $box = null
 
         // annotations overlay their sub box - not their own box //
@@ -515,7 +515,10 @@
             element: source,
             stripOuter: true,
             success: function(text){
-		let ttext = $.trim(text);
+		let ttext = text;
+		if (trim) {
+		    ttext = ttext.trim();
+		}
                 $('textarea', $overlay).val(ttext);
 
                 setTimeout(function(){
@@ -951,6 +954,7 @@
 		let $e = $(e);
 		if ($e.closest('[x-node="abstrakt"]').length) return;
 		if ($e.closest('[x-node="nota_red"]').length) return;
+		if ($e.closest('[x-annotation-box="true"]').length) return;
 		let node = $e.attr('x-node');
 		if (node == 'numeracja') {
 		    number = 0;