使用uparse的方式
<script type="text/javascript" charset="utf-8" src="/ueditor.parse.min.js"> </script>
uParse(".panel-body.detail", {
rootPath:'/path', //第三方高亮插件的位置
chartContainerHeight:500
});使用SyntaxHighlighter.highlight();或SyntaxHighlighter.all();
<link href="/Contents/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css" rel="stylesheet" type="text/css" /> <script src="/Contents/ueditor/third-party/SyntaxHighlighter/shCore.js" type="text/javascript"></script>
代码高亮后设置自动换行
.syntaxhighlighter
{
width: 100% !important;
margin: .3em 0 .3em 0 !important;
position: relative !important;
overflow: auto !important;
background-color: #f5f5f5 !important;
border: 1px solid #ccc !important;
border-radius: 4px !important;
border-collapse: separate !important;
word-break:break-all; /* 新增样式 */
}
评论(0)
登录 后参与评论。