所以基本上我使用的是棱镜语法高亮显示器,而且我已将contenteditable
放在div上。如果在按下某个键时在div中显示标签,则会在div的开头插入。这是我的代码:
<head>
<title>
Syntax highlighting test
</title>
<!-- Prism JS -->
<script src="pe.js"></script>
<!-- Prism CSS -->
<link type="text/css" rel="stylesheet" href="prism.css">
</head>
<body>
<pre id="hello-world"><code id="kdh" class=" language-html line-numbers" contenteditable onKeyUp="Prism.highlightAll();"><h1h>HIHI</h1></code></pre>
</body>