网上搜索的解决办法(测试无效)
找到高亮代码显示的css文件 /e/data/ecmseditor/ueditor/third-party/SyntaxHighlighter/shCoreDefault.css
代码如下:
.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;
}
修改代码如下:
.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;
word-break:break-all;//添加的代码
}
具体的路径根据你的ueditor做改动
就是加上 word-break:break-all;
可能不同的ueditor版本css写法不一样,只要对应的位置加上这个强制换行就可以了
有效解决方法
问题界定:各浏览器对pre标签的解释问题,针对 firefox,怎么使pre标签内容自动换行?
处理方法:在前台文章模版样式中加入以下样式代码
<style type="text/css">
pre {
white-space: pre-wrap;
word-wrap: break-word;
}
</style>
完成,如果对你有帮助还请关注我哦!