我正在使用 CKEditor 4.4.5 及其插件 Stylesheet Parser 4.4,但我从样式下拉列表中得到空列表。
为了让我的问题更容易理解,请尝试以下代码(从其示例站点下载:http ://sdk.ckeditor.com/samples/styles.html ):
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<title>Stylesheet Parser plugin</title>
<script src="http://cdn.ckeditor.com/4.5.2/standard-all/ckeditor.js"></script>
</head>
<body>
<textarea cols="80" id="editor2" name="editor2" rows="10" ><p>This is some <strong>sample text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.</p>
</textarea>
<script>
CKEDITOR.replace( 'editor2', {
extraPlugins: 'stylesheetparser',
height: 300,
// Custom stylesheet for editor content.
contentsCss: [ 'http://sdk.ckeditor.com/samples/assets/stylesheetparser/stylesheetparser.css' ],
// Do not load the default Styles configuration.
stylesSet: []
} );
</script>
</body>
</html>
它真的不起作用。但是该站点上的示例运行良好。我还找到了另一个示例站点: http ://ckeditor.com/ckeditor_4.3_beta/samples/plugins/stylesheetparser/stylesheetparser.html
我试图从这个演示站点复制所有源代码,但没有成功。
其他人有同样的问题吗?我怎样才能使上面的代码工作?它基本上使用来自 CDN 站点的源代码,所以我认为源代码的版本并不重要。