我创建了一个带有语法高亮显示的ckeditor,它工作正常,当我在代码段中编写某些代码(无论是php代码还是其他任何语言)并单击Submit按钮时,它将向我显示简单的纯文本代码,其中代码未突出显示。我不知道为什么?这是我的代码。
<?php
if($this->input->post('submit'))
{
echo $this->input->post('editor1');
}
?>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="ckeditor/ckfinder/ckfinder.js"></script>
<script type="text/javascript" src="ckeditor/plugins/syntaxhighlight/scripts/shCore.js"></script>
<script type="text/javascript" src="ckeditor/plugins/syntaxhighlight/scripts/shBrushCss.js"></script>
<script type="text/javascript" src="ckeditor/plugins/syntaxhighlight/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="ckeditor/plugins/syntaxhighlight/scripts/shBrushPhp.js"></script>
<script type="text/javascript" src="ckeditor/plugins/syntaxhighlight/scripts/shBrushPlain.js"></script>
<script type="text/javascript" src="ckeditor/plugins/syntaxhighlight/scripts/shBrushSql.js"></script>
<script type="text/javascript" src="ckeditor/plugins/syntaxhighlight/scripts/shLegacy.js"></script>
<link rel="stylesheet" href="ckeditor/plugins/syntaxhighlight/styles/shCoreDefault.css" />
<script>
var editeur = CKEDITOR.replace('editor1',
{
toolbar: 'Basic'
},
{
language: "fr"
});
CKFinder.setupCKEditor(editeur, '/ckfinder/');
</script>
<form method="post">
<textarea id="editor1" name="editor1" class="col-xs-12 ckeditor"></textarea>
<input class="btn btn-info" type="submit" name="submit" id="submit" value="Submit" />
</form>