fixes #940
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 15 Nov 2010 13:18:54 +0000 (14:18 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Mon, 15 Nov 2010 13:18:54 +0000 (14:18 +0100)
redakcja/static/js/wiki/view_editor_wysiwyg.js
redakcja/static/xsl/wl2html_client.xsl

index 92397b0..4e0bdee 100644 (file)
                     xml2html({
                         xml: '<' + nodeName + '>' + insertedText + '</' + nodeName + '>',
                         success: function(element){
-                            $origin.html($(element).html());
+                            if (nodeName == 'out-of-flow-text') {
+                                $(element).children().insertAfter($origin);
+                                $origin.remove()
+                            }
+                            else {
+                                $origin.html($(element).html());
+                            }
                             $overlay.remove();
                         },
                         error: function(text){
index 4414b0a..1739f62 100644 (file)
        
        <!-- 
                Earlier versions of html2wl introduced a BUG, that 'causes "out-of-flow-text" tag to appear.
-               Instead of marking it as "unknown", just pass thru it
+               Instead of marking it as "unknown", just pass thru it.
+               Keep a pass-thru span for out-of-flow box editing
        -->
-       <xsl:template match="out-of-flow-text">
-               <xsl:param name="mixed" />
-               <xsl:apply-templates select="child::node()">
-                <xsl:with-param name="mixed" select="$mixed" />
-            </xsl:apply-templates>
-       </xsl:template> 
+    <xsl:template match="out-of-flow-text">
+        <span data-pass-thru="true">
+            <xsl:apply-templates select="child::node()">
+                <xsl:with-param name="mixed" select="false()" />
+            </xsl:apply-templates>        
+        </span>
+    </xsl:template>
 
     <xsl:template match="*">
         <span class="unknown-tag" x-node="{name()}">