[英]CKEditor inline code snippets highlighting
我在將棱鏡代碼片段語法突出顯示與CKEditor
的嵌入式版本集成時遇到問題,我已經在<head>
標記中添加了所需的JS和css文件,但是突出顯示似乎不起作用
注意:突出顯示在完整的編輯器版本下正常工作(“替換”而不是“內聯”)
這是我的代碼:
<title>Title</title>
<link rel="stylesheet" href="plugins/codesnippet/lib/highlight/styles/arta.css">
<script src="ckeditor.js"></script>
<script src="plugins/codesnippet/lib/highlight/highlight.pack.js"></script>
</head>
<body>
<div id="editor" contenteditable="true">
<h1>Hello world!</h1>
<p>I'm an instance of <a href="http://ckeditor.com">CKEditor</a>.</p>
</div>
</body>
<script language="JavaScript">
(function() {
CKEDITOR.inline('editor')
})();
</script>
</html>
我發現導致問題的原因似乎是Prism Highlighter無法處理Prism JS和CSS文件的自動加載,解決方案是針對這兩行:
<script src="plugins/prism/lib/prism/prism_patched.min.js"></script>
<link rel="stylesheet" href="plugins/prism/lib/prism/prism_patched.min.css">
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.