]> _ Git - fluidbook-html5.git/commitdiff
wait #2354 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 21 Nov 2018 15:43:44 +0000 (16:43 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 21 Nov 2018 15:43:44 +0000 (16:43 +0100)
js/libs/fluidbook/fluidbook.menu.js

index 10200c8b8895551abd31de36a5b2982f2536f643..a0ec7df3dc951c7eb93fb2cd6f351e65b08cf26f 100644 (file)
@@ -451,8 +451,15 @@ FluidbookMenu.prototype = {
         }
     },
     openText: function (text, callback) {
+        var styleMatches = text.match(/\<style\>([^\<]*)<\/style>/);
+        var style = '';
+
+        if (styleMatches !== undefined && styleMatches !== null && styleMatches.length > 1) {
+            style = styleMatches[1].replace(/\s/g, '');
+        }
+        text = text.replace(/\<style\>([^\<]*)<\/style>/g, '');
         var t = '<div class="caption">' + this.closeButton() + '<h2></h2></div>';
-        t += '<div class="content"><div class="text">' + text + '</div></div>';
+        t += '<div class="content"><div class="text" style="' + style + '">' + text + '</div></div>';
         $("#view").append('<div class="mview" data-menu="text">' + t + '</div>');
         if (callback != undefined) {
             callback();