CKEditor更改我所有的HTML [英] CKEditor changing all my HTML

查看:96
本文介绍了CKEditor更改我所有的HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我整天都在与CKEditor挣扎。全部是因为它正在重新格式化我所有的HTML。由于某些原因,它会将< dl> 之类的标签替换为< div> < p> 。因此,我选择了此插件,并将其中一个预定义按钮的HTML输出更改为:

 < dl class = accordion data-accordion> 
< dd class = accordion-navigation>
< a href =#panel1> Redigera sidor< / a>
< div id = panel1 class = content>
< a href = edit_index.php title = Redigera startsidan> Redigera startsidan< / a>
< / div>
< / dd>
< / dl>

有关此代码块的更多信息此处



当我按下按钮时,CKEditor将输出以下代码:

 < p>< a href =#panel1> Redigera sidor< / a>< / p> 

< div class = content>< a href = edit_index.php> Redigera startsidan< / a>< / div>

< a" a href =#panel2> Inst& auml; llningar< / a< / p>

< div class = content>< a href = memberlist.php> Administrat& ouml; rer lista< / a>< / div>

我不明白为什么会这样。我正在Foundation 5上使用CKEditor 4.3.2。



更新



I尝试改用此插件: http://ckeditor.com/addon/templates 并更改HTML模板之一:

  {
标题: Ny radioprogram,
图片: template2.gif',
说明:'定义两个列的模板,每个列都有一个标题和一些文本。',
html:'< div class = row>'+
'< div class = small-2 large-4 column< p> Skriv titeln och infoga din Youtube radioprogram< / p>< / div>'+
'< / div>'
},

结果相同,CKEditor仍在输出错误的代码。这是输出:

 < p>& nbsp;< / p> 

< p> Skriv专辑和Youtube广播节目< p

< / p>

我想我有充分的证据表明我的CKEditor不能正常工作。有任何线索吗?

解决方案

阅读有关内容过滤。有多种方法可以配置CKEditor的内容过滤机制(称为高级内容过滤器)我不能只在这里显示一次,因为这会引起误解。



更新:更改任何配置选项后,清除浏览器缓存。 / p>

I have been struggling with CKEditor the whole day long. All because it is re-formatting all my HTML. For some reason, it replaces tags like <dl> for <div> or <p>. So, I took this plugin and changed the HTML output of one of the predefined buttons into:

<dl class="accordion" data-accordion>
    <dd class="accordion-navigation"> 
      <a href="#panel1">Redigera sidor</a> 
        <div id="panel1" class="content"> 
          <a href="edit_index.php" title="Redigera startsidan">Redigera startsidan</a>
        </div> 
    </dd> 
</dl>

More info about this code block here.

When I press the button, CKEditor outputs the following code:

<p><a href="#panel1">Redigera sidor</a></p>

<div class="content"><a href="edit_index.php">Redigera startsidan</a></div>

<p><a href="#panel2">Inst&auml;llningar</a></p>

<div class="content"><a href="memberlist.php">Administrat&ouml;rer lista</a></div>

I cannot understand why is this happening. I am using CKEditor 4.3.2 with Foundation 5.

UPDATE

I have tried to use this plugin instead: http://ckeditor.com/addon/templates and change the HTML of one of the templates to:

{
        title: 'Ny radioprogram',
        image: 'template2.gif',
        description: 'A template that defines two colums, each one with a title, and some text.',
        html: '<div class="row">' +
                   '<div class="small-2 large-4 columns"><p>Skriv titeln och infoga din Youtube radioprogram</p></div>' +
               '</div>'
    },

The result is the same, CKEditor is still outputting the wrong code. This is the output:

<p>&nbsp;</p>

<p>Skriv titeln och infoga din Youtube radioprogram</p>

<p>&nbsp;</p>

I guess I have strong evidence that something is not ok with my CKEditor. Any clues?

解决方案

Read about the Content Filtering. There are many ways to configure CKEditor's content filtering mechanism (called the Advanced Content Filter) so I can't just show here once, because that would be misleading.

Update: Clear your browsers cache after changing any configuration option.

这篇关于CKEditor更改我所有的HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆