나는이 문제로 어려움을 겪고있다. 나는 자바 스크립트에 대해 매우 익숙하다. 내 웹 사이트에서 작동하는 tinymce v3을 가지고 있었지만, 업데이트하기를 원했다. 그래서 v4를 설치하면 잠시 시간이 걸렸지 만 최종적으로 일하게되었습니다. 그것의 텍스트 영역을 보여줍니다. 내 페이지를 게시 할 때 html 태그가있는 텍스트가 아니라 문자열 만 반환합니다. 그리고 내가 blockquotes를 사용할 때 [quote] [/ quote]로 문자열을 반환한다. 이것은 내가 사용하는 코드입니다.Tinymce가 HTML을 반환하는 것이 아니라 단지 텍스트
<script src="@Url.Content("~/Scripts/tinymce/jquery.tinymce.min.js")" type="text/javascript"></script>
<script type="text/javascript">
(function(){
$(function() {
$('#@ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)').tinymce({
// Location of TinyMCE script
script_url: '@Url.Content("~/Scripts/tinymce/tinymce.js")',
theme: "modern",
height: "300",
width: "1150",
verify_html: true,
statusbar: true,
plugins : "pagebreak,bbcode,link,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,thisisnotvaled,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,codehighlighting,netadvimage",
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 : "@Url.Content("~/Scripts/tinymce/css/content.css")",
convert_urls: false,
// TODO: Make line breaks work and qoutes are now also not working
force_br_newlines: true,
force_p_newlines: true,
forced_root_block: '',
remove_linebreaks: false,
convert_newlines_to_br: true,
// 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"
});
});
})();
</script>
또한 HTML을 반환하지 않기 때문에 주로 줄 바꿈을 강요하지 않습니다. 나는 수색을하고 있었지만 구체적인 것은 아무것도 찾지 못했다. 그래서 그냥 simplyfy하기 위해이 같은 그것을 반환 : 알아 나에게 전체 24 시간 걸렸다 Hello world. But i want it like this : <p>hello world</p>