블로그 기사를 내 웹 사이트에 추가 할 수있는 WYSIWYG 편집기 (TinyMCE)가 있습니다. 방금 정상적인 단락을 쓸 경우 :WYSIWYG의 출력 HTML을 슬래시와 따옴표로 변환하십시오.
<p><strong>Hello world!</strong></p>
잘 출력됩니다. 이 슬래시의 엉망
<p>This is some test <span style=\"text-decoration: underline;\">content</span> with <a href=\"\\"\\\\"http:/www.google.com\\\\"\\"\" target=\"\\"\\\\"_blank\\\\"\\"\">more</a> <em>tags</em> than I would <strong>normally</strong> add.</p>
: 나는 예를 들어 링크와 밑줄을위한 몇 가지 추가 HTML을 시도하지만, 내 편집기가 작동하지 않습니다 화면에 인쇄하거나 제대로 보이지 않습니다 다음을 추방 및 따옴표. 어떻게 처리해야합니까? 어떤 방법이나 기능? 스타일 태그보다 링크가 더 염려 스럽습니다. 어떤 충고라도 잘 될 것입니다. 나는 이후 <SPAN>
태그를 고정하지만 A
태그가 해결되지 위해서 stripslashes()를 사용했습니다 1
UPDATE.
MY 설정 이 내 TinyMCE에 편집기 코드 :
<script>
tinyMCE.init({
mode : "exact",
elements : "content",
theme : "advanced",
plugins : "autolink,lists,spellchecker,pagebreak,advhr,advlink,iespell,inlinepopups,"
+ "print,noneditable,visualchars,nonbreaking,xhtmlxtras",
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,bullist,"
+ "numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_buttons4 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_resizing : true,
width: "100%",
height: "425"
});
</script>
텍스트 영역의 내용이 다음 게시 (POST) AJAX를 통해 다른 페이지와 데이터베이스에 그대로 다음 을 저장. 가서이 WYSIWYG HTML을 페이지에 인쇄하면 DB에서 다음과 같이 쓸 수 있습니다 :
에 대한 내용은 http://stackoverflow.com/questions/1960920/php-htmlentities-to-decode-textarea – Deepak
에 있습니다. @Deepak : 감사합니다. SPAN 태그는 정렬되었지만 ''태그는 정렬하지 않았습니다. – ShadowStorm
당신이하려고하는 실제 링크가 무엇입니까? TinyMCE에서 사용하고있는 실제 데이터와'span' 태그를 얻기 위해 지금 사용하고있는 코드를 게시 할 수 있습니까? – Deepak