zoukankan      html  css  js  c++  java
  • 百度编辑器ueditor代码高亮效果前台不显示的解决方法

    原文:http://my.oschina.net/miaowang/blog/285948

    1
    2
    3
    4
    5
    6
    7
    8
    9
    <link href="你的ueditor路径/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css" rel="stylesheet" type="text/css" />  
     
    <script type="text/javascript" src="你的ueditor路径/ueditor/third-party/SyntaxHighlighter/shCore.js"></script>  
     
    <script type="text/javascript">      
     
    SyntaxHighlighter.all();       
     
    </script>

    PS:在内容里面插入代码高亮显示,后台编辑器中是可以自动换行的,但是发表后,在前台查看,发现代码不能自动换行,直接超出了内容页的边界,造成极不美观的效果。于是想尽办法,查找问题,经过不懈努力,终于解决了此问题。
    下面来分享下方法:
    以下文件需要修改:
    /ueditor/third-party/SyntaxHighlighter/shCoreDefault.css
    打开:shCoreDefault.css
    找到81行,

    1
    <span style="FONT-SIZE: 14px">.syntaxhighlighter table {  <br><br>  width100% !important;  <br><br>    border1px solid #c0c0c0 !important;  <br><br>}<br></span>

    修改为:

    1
    <span style="FONT-SIZE: 14px">.syntaxhighlighter table {  <br><br>  width100% !important; word-break:break-all;  <br><br>    border1px solid #c0c0c0 !important;  <br><br>}<br></span>

    即可实现自动换行,增加了一句:word-break:break-all;代码,
    意思是:强制打断并换行的意思。

  • 相关阅读:
    全排列(next_permutation)
    Codeforces Round #321 (Div. 2)C(tree dfs)
    cf_ducational Codeforces Round 16_D(gcd)
    cf455a(简单dp)
    cf584a(水题)
    cf112a(水题)
    冒泡排序
    Python内置类型性能分析
    常见时间复杂度
    MongoDB 备份
  • 原文地址:https://www.cnblogs.com/hefei/p/5435792.html
Copyright © 2011-2022 走看看