kindeditor配置syntaxhighlighter…「建议收藏」

kindeditor配置syntaxhighlighter…「建议收藏」kindeditor默认是prettify,我行号没弄出来,换了syntaxhighlighter,下面是配置的代码。。。 kindeditortest body{ font-family:”MicrosoftYaHei”; } #editor{ word-wrap:break-word; } #ContentSubm

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用


kindeditor默认是prettify,我行号没弄出来,换了syntaxhighlighter,下面是配置的代码。。。

<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8">
		<title>kindeditor test</title>
		<style>
			body{
				font-family:"Microsoft YaHei";
			}
			
			#editor{
				word-wrap:break-word;
			}
			#ContentSubmit{
				width:80px;
				height:30px;
				background:#336633;
				border:0 solid #000000;
				cursor:pointer;
				color:#ffffff;
				font-size:15px;
				margin:10px 0;
			}
			#ContentSubmit:hover{
				background:#336666;
			}
			#editor-box{
				margin-left:auto;
				margin-right:auto;
				width:900px;
				height:200px;
				word-wrap:break-word;
			}
		</style>
		<!--加载sh插件-->
		<script src="./kindeditor/plugins/code/scripts/shCore.js"></script>
		<script src="./kindeditor/plugins/code/scripts/shBrushJScript.js"></script>
		<link rel="stylesheet" href="./kindeditor/plugins/code/styles/shThemeDefault.css"/>
		<link rel="stylesheet" href="./kindeditor/plugins/code/styles/shCore.css"/>
		<!--加载kindeditor-->
		<link rel="stylesheet" href="./kindeditor/themes/default/default.css" />
		<script charset="utf-8" src="./kindeditor/kindeditor-min.js"></script>
		<script charset="utf-8" src="./kindeditor/lang/zh_CN.js"></script>
		<script>
			var editor;
			KindEditor.ready(function(K) {
				editor = K.create('textarea[name="content"]', {
					width:'900px',
					resizeType : 1,
					allowPreviewEmoticons : false,
					allowImageUpload : true,
					allowFileManager : true,
					items : [
						'source','|',
						'bold','italic','underline','|',
						'fontname','fontsize','|',
						'code','|',
						'image','|',
						'link','media','|',
						'about'
					]
				});
				editor.sync();
			});
		</script>
	</head>
	<body>
		<h1>Hello SyntaxHighlighter</h1>
		<pre class="brush: js;">
			function helloSyntaxHighlighter()
			{
				return "hi!";
			}
		</pre>
		<div id="editor-box">
			<div style="display:block;word-break: break-all;word-wrap: break-word;">
				<?php
					echo $_POST["content"];
				?>
			</div>
			<form action="test2.php" method="POST">
				<textarea id="editor" name="content" style="width:900px;height:200px;visibility:hidden;overflow:hidden;"></textarea>
				<input type="submit" id="ContentSubmit" value="提交评论" />
			</form>
		</div>
		<!--script type="text/javascript">var a = function(){document.getElementById("editor").getElementByTagName("pre")[0].className="brush:js";};</script-->
		<script>
			SyntaxHighlighter.config.clipboardSwf = './kindeditor/plugins/code/scripts/clipboard.swf';
			SyntaxHighlighter.all();
		</script>
	</body>
</html>

路径根据自己的来了,值得一提的是刚开始虽然有行号了,但是没有换行,尝试了很多,无果,直接在打印的东西外边加div强制换行,也不知道这样好不好,

<pre class="brush: js;">
			function helloSyntaxHighlighter()
			{
				return "hi!";
			}
		</pre>

还有在ie里边的好多问题,不能复制。。。

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/182988.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • linux chmod 755 ,750,777

    linux chmod 755 ,750,777一直没用过chmod777(755,750)的命令,也不知道具体是什么作用,尤其不知道755,750,777分别代表什么意思,只记得有一次咨询一个同门时告诉我不要设置成777模式,后来就没有接触了。因为今天又用到了,所以整理归纳以一下。chmod是Linux下设置文件夹权限的命令,后面一般跟三个数据,代表不用用户群体在这个文件夹上的权限设置:一般是三个数字:chmod750dir_wzg第一个数字表示文件所有者的权限第二个数字表示文件所有者同属一个用户组的其他用户在该文件上的权限

    2022年7月16日
    40
  • lrzsz命令包的下载及安装

    lrzsz命令包的下载及安装安装lrzsz命令包后可以使用上传(rz)命令和下载(sz)命令安装推荐yum可以一步到位从下载到安装(https://img-blog.csdnimg.cn/20190411194245896.png)

    2022年6月23日
    64
  • 海思Hi3798MV310芯片处理器参数介绍「建议收藏」

    海思Hi3798MV310芯片处理器参数介绍「建议收藏」Hi3798MV310是用于IPTV/OTT机顶盒市场的支持4KP60解码的超高清高性能SOC芯片。集成4核64位高性能CortexA53处理器和多核高性能2D/3D加速引擎;支持H.265/AVS24Kx2K@P6010bit超高清视频解码,高性能的H.265高清视频编码,HDR视频解码及显示,HDR转SDR,BT.2020,Dolby和DTS音频处理;内置USB2.0…

    2022年6月28日
    195
  • ArrayList遍历的三种方式[通俗易懂]

    ArrayList遍历的三种方式[通俗易懂]1publicclassArrayListTraversal{2publicvoidarrayListTraversal(List<Integer>lists){3/

    2022年7月4日
    29
  • 递归实例详解

    递归实例详解

    2021年9月16日
    50
  • 分离字符串中的字母和数字并使得字母在前数组在后

    分离字符串中的字母和数字并使得字母在前数组在后大搜车校招编程题:分离字符串中的字母和数字并使得字母在前数组在后public class 校招 { static String stringCharFrontNumEnd(String string){ if(string==null ||string.length()==0) return null; String c…

    2022年6月13日
    33

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号