Home > php教程 > PHP开发 > kindeditor与SyntaxHighlighter通用整合方法2

kindeditor与SyntaxHighlighter通用整合方法2

WBOY
Release: 2016-06-07 17:23:40
Original
1380 people have browsed it

前台代码高亮显示的问题,在kindeditor与SyntaxHighlighter通用整合方法已经解决。但问题又来了:当你编辑代码时,发现在编辑器中显示的代码不完整!


这是为什么呢?难道是我们在后台插入的代码不完整?当然不是。我们在后台插入代码是没有问题的,你从数据表查看插入的代码就可以知道,代码是完整的。造成代码显示不完整,原因是代码插入数据库前,如"


解决在线编辑器kindeditor编辑代码显示不完整的方法


从数据库取出代码内容后,先对其进行转义即把“&”,转换为“&”实体(html中,“&”的字符实体是“&”)。看代码:

public function getedit() { 
             if (empty($
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template