TLP*_*TLP 1 php linux ckeditor
问题:
CKEditor正在向<span>
纯文本添加大量标签,例如下面的示例.
代码:
设置是一个php页面,调用ckeditor并将条目保存到PostgreSQL表中.我相信CKEditor上的大多数设置都是默认设置.这是一些代码:
include ('./ckeditor/ckeditor.php') ;
$CKEditor = new CKEditor() ;
$CKEditor->returnOutput = true;
$CKEditor->basePath = '/ckeditor/';
$CKEditor->config['width'] = 560;
$CKEditor->config['height'] = 300;
$CKEditor->textareaAttributes =
array("cols" => 90, "rows" => 70);
$CKEditor->config['DefaultLanguage'] = "sv" ;
//$CKEditor->config['EnterMode'] = CKEDITOR.ENTER_BR;
$config['toolbar'] = array(
array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike', '-' ),
array( 'Image', 'Link', 'Unlink', '-', 'Table', 'NumberedList','BulletedList' )
);
$config['skin'] = 'v2';
Run Code Online (Sandbox Code Playgroud)
示例输入/输出(在源中):
输入:
En hel del av er
Run Code Online (Sandbox Code Playgroud)
变为:
En <span data-scayt_word="hel" data-scaytid="2">hel</span> del
<span data-scayt_word="av" data-scaytid="3">av</span>
<span data-scayt_word="er" data-scaytid="4">er</span>
Run Code Online (Sandbox Code Playgroud)
有没有办法避免这种行为?
最简单的方法:禁用拼写检查程序(scayt - 拼写时拼写检查)
$CKEditor->config['removePlugins'] ='scayt'; // comma separated if many
Run Code Online (Sandbox Code Playgroud)
如果要保留SCAYT,但阻止该功能自动打开:
$CKEditor->config['scayt_autoStartup'] = false;
Run Code Online (Sandbox Code Playgroud)
但这是奇怪的行为,你如何从ckeditor实例中检索内容?只是尝试从firebug获取数据以查看不脏的内容:
console.log( CKEDITOR.instances.your_instance_name.getData() );
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3347 次 |
最近记录: |