gpt4 book ai didi

javascript - ckeditor 实体 html 数据库

转载 作者:行者123 更新时间:2023-11-29 17:47:18 28 4
gpt4 key购买 nike

我正在将 CKEditor 与 CodeIgniter 一起使用,并且我将编辑器配置为发送 HTML 字符,但标签未正确发送 enter image description here

这是插入数据库的 Controller :

public function create()
{
$extra = array(
'return' => "{$this->_route}index/",
'success_message' => lang("{$this->_language}:submit_success"),
'failure_message' => lang("{$this->_language}:submit_failure"),
'title' => lang("{$this->_language}:create"),
);
//$this->streams = 'htmlspecialchars',
$this->streams->cp->entry_form($this->slug_stream, $this->namespace, 'new', null, true, $extra);
}

这是config.js文件中ckeditor的配置

/**
* @license Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.html or http://ckeditor.com/license
*/

CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here.
// For the complete reference:
// http://docs.ckeditor.com/#!/api/CKEDITOR.config
config.entities_latin = false;
config.forcePasteAsPlainText = false;
config.fillEmptyBlocks = false;
config.basicEntities = false;
config.entities_additional = '#1049';
config.entities = false;
config.specialChars = [ '"', '’', [ '&custom;', 'Custom label' ] ];
config.specialChars = config.specialChars.concat( [ '"', [ '’', 'Custom label' ] ] );
// The toolbar groups arrangement, optimized for two toolbar rows.
config.toolbarGroups = [
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] },
{ name: 'links' },
{ name: 'insert' },
{ name: 'forms' },
{ name: 'tools' },
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ] },
{ name: 'others' },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align' ] },
{ name: 'styles' },
{ name: 'colors' },
{ name: 'about' }
];

// Remove some buttons, provided by the standard plugins, which we don't
// need to have in the Standard(s) toolbar.
config.removeButtons = 'Underline,Subscript,Superscript';
};

最佳答案

你好,我找到了一个解决方案,即在 View 中呈现它以批准 html_entity_decode,

'description' =>html_entity_decode($item['description'])

关于javascript - ckeditor 实体 html 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49700825/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com