Tuesday, 15 July 2014

javascript - Tinymce not displaying html correctly? -



javascript - Tinymce not displaying html correctly? -

i have below content coming server showing under textarea attached tinymce

<p>test1</p> <p>test2</p>

i see in browser below p tags

<p>test1</p> <p>test2</p>

thougs should show

test1 test2

i not sure missing here? dont see error in firebug console.when inspect textarea firebug, textarea attached correctly tinymce somehow not displaying html content in right format? using struts 2 textarea i.e

here tinymce configuration:-

function attachtinymce() { tinymce.init({ mode: "textareas", theme: "advanced", plugins: "preview", readonly: true, theme_advanced_buttons1: "forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,|,formatselect,fontselect,fontsizeselect,sub,sup,|,bold,italic,underline,strikethrough", theme_advanced_buttons2: "", theme_advanced_toolbar_location: "top", theme_advanced_toolbar_align: "left", theme_advanced_statusbar_location: "bottom", theme_advanced_path: false, theme_advanced_resizing: true, entity_encoding: "raw" }); }

update:- if send below content server i.e

<p>test1</p> <p>test2</p>

instead of

&lt;p&gt;test1&lt;/p&gt; &lt;p&gt;test2&lt;/p&gt;

it shown correctly in tinymce i,e

test1 test2

&lt;p&gt; gets treated string oninit of editor. if want evaluated tag need replace &lt;p&gt; < etc... before init editor.

javascript struts2 tinymce wysiwyg

No comments:

Post a Comment