Saturday, 15 February 2014

javascript - tinymce-knockout-binding not showing formatting -



javascript - tinymce-knockout-binding not showing formatting -

i'm trying tinymce-knockout-binding plugin michaelpapworth (an awesome plugin way). problem i'm having i'm trying bind editor pre-existing html markup, it's showing tags instead of showing formatted.

here's jsfiddle showing problem: http://jsfiddle.net/rsparkyc/mt7cf/2/

my view model follows:

function viewmodel() { var self = this; self.wysiwygoptions = { forced_root_block: false }; self.selectedtext = ko.observable('i want this<br /><h1>to show formatting</h1>in editor'); }

and i'm binding observable this:

<div class="editablearea" data-bind="wysiwyg: selectedtext, wysiwygconfig: wysiwygoptions"></div>

on line 14 of plugin

e(i).text(s()());

this assumes posting plain text... can alter line

e(i).html(s()());

and correctly format.. believe setcontent function used on update accommodates html should not need farther upgrades

javascript knockout.js tinymce

No comments:

Post a Comment