大佬教程收集整理的这篇文章主要介绍了TinyMCE在保存和重新加载数据后显示html标签,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
保存编辑器的内容并重新显示后,所有HTML标记都可见.
这就是我正在初始化编辑器的方式:
TinymCE.init({ setup: function (ed) { ed.onSaveContent.add(function (ed,o) { o.content = o.content.replace(/'/g,'&apos'); }); },// General options mode: 'specific_textareas',theme: 'advanced',encoding: 'xml',entity_encoding: 'raw',height: '500',width: '100%',plugins: 'autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetiR_690_11845@e,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave',editor_SELEctor: 'rich-text-area',editor_deSELEctor: 'text-area',// Theme options theme_advanced_buttons1: 'save,newdocument,|,bold,italic,underline,Strikethrough,justifyleft,justifycenter,justifyright,justifyfull,styleSELEct,formatSELEct,fontSELEct,fontsizeSELEct',theme_advanced_buttons2: 'cut,copy,pastetext,pasteword,search,replace,bullist,numlist,outdent,indent,blockquote,undo,redo,link,unlink,anchor,image,cleanup,Help,code,insertdate,inserttime,forecolor,BACkcolor',theme_advanced_buttons3: 'tablecontrols,hr,removeformat,visualaid,sub,sup,charmap,ltr,rtl,fullscreen',theme_advanced_toolbar_LOCATIOn: 'top',theme_advanced_toolbar_align: 'left',theme_advanced_statusbar_LOCATIOn: 'bottom',theme_advanced_resizing: false,// Example content CSS (should be your site CSS) content_css: 'css/content.css',// Drop lists for link/image/media/template dialogs template_external_list_url: 'lists/template_list.js',external_link_list_url: 'lists/link_list.js',external_image_list_url: 'lists/image_list.js',media_external_list_url: 'lists/media_list.js',// Style formats style_formats: [ { title: 'Bold text',inline: 'b' },{ title: 'Red text',inline: 'span',styles: { color: '#ff0000'} },{ title: 'Red header',block: 'h1',{ title: 'Example 1',classes: 'example1' },{ title: 'Example 2',classes: 'example2' },{ title: 'Table styles' },{ title: 'Table row 1',SELEctor: 'tr',classes: 'tablerow1' } ] });
重新显示后的数据:
数据存储在数据库中:
<p>TesTing</p>
好像你需要在你的配置上评论编码:’xml’.
以上是大佬教程为你收集整理的TinyMCE在保存和重新加载数据后显示html标签全部内容,希望文章能够帮你解决TinyMCE在保存和重新加载数据后显示html标签所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。