我做了一个 codemirror 编辑器,但我有一些问题
这是我的代码 php 代码-
<?php
$parameter = $_GET['codefilename'];
$code = file_get_contents($parameter);
?>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
mode: 'htmlmixed',
lineNumbers: true
});
</script>
和
<textarea id="code">
<html>
<head>
<title>title</title>
</head>
<body>
codes.....
</body>
</html>
</textarea>
此代码突出显示,但由 php 代码打开不突出显示代码不突出显示-
<textarea id="code"><?=$code?></textarea>
在 textarea $code 中没有突出显示。如何修复它