CKEditor 通过将单引号转换为双引号来破坏自定义 .NET 标记
应客户要求,我们刚刚将大型网站的定制CMS系统从FCKEditor 2.x升级到CKEditor 3.5.3。
在 ItemTemplate 内部,我有一个自定义 UserControl 标记,其中的属性由 DataBinding 填充,如下所示:
<my:Viewer runat="server">
<ItemTemplate>
<my:CustomTag runat="server"
ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ImageUrl") %>' />
</ItemTemplate>
</my:Viewer>
所以,重点是上面的工作正常。但是,当将 HTML 放入最新的 CKEditor 时,CKEditor 更改 ImageUrl 属性以使用双引号而不是单引号。一旦改为双引号,就会导致.aspx页面出现解析错误。将 "ImageUrl" 更改为 "ImageUrl"
可行,但对于我们的客户来说并不理想,因为他们必须更新非常大的 CMS 系统中存在的每个页面。因此,我问这个问题希望有人知道一种方法来切换 CKEditor 默认情况下在 HTML 属性中使用单引号而不是双引号,以减少我的客户必须要做的工作量。
我只是在寻找简单的配置类型更改,而不是修补编辑器等。
At the client's request, we just upgraded a custom CMS system for a large site from FCKEditor 2.x to CKEditor 3.5.3.
Inside an ItemTemplate I have a custom UserControl tag in which the attributes are populated by DataBinding, like so:
<my:Viewer runat="server">
<ItemTemplate>
<my:CustomTag runat="server"
ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ImageUrl") %>' />
</ItemTemplate>
</my:Viewer>
So, the point is that the above works just fine. However, when the HTML is put into the latest CKEditor, CKEditor changes the ImageUrl attribute to use double-quotes instead of single quotes. Once it's changed to double quotes, it causes a parsing error on the .aspx page. Changing: "ImageUrl" to "ImageUrl"
works, but it's not ideal for our client who is going to have to update every page that exists in a very large CMS system. So, I'm asking this question hoping someone might know of a way to toggle CKEditor to use single quotes in HTML attributes by default instead of double quotes to reduce the amount of work my client is going to have to do.
I'm only looking for easy configuration-type changes, not patching the editor, etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这应该可以实现你想要的
取自这里
http://cksource.com/forums /viewtopic.php?f=11&t=20647&sid=f47526ecfb1f2303ad0b923ceed7aafe&start=10
避免 CKEditor 更改特殊字符:
在源视图中切换:
保存编辑文档时:
This should do what you want
Taken from here
http://cksource.com/forums/viewtopic.php?f=11&t=20647&sid=f47526ecfb1f2303ad0b923ceed7aafe&start=10
To avoid CKEditor changing special chars:
switching in source view:
When save edited document:
我要说的是"我提到的解决方案是工作量太大,这只是唯一的答案……只是为了对此进行一些总结。或者,如果我能找到办法,我会撤回这个问题。感谢 rqmedes 的尝试...在收到您的回复之前,我实际上已经忘记了这个问题
:)
I'm going to say that the " solution that I mentioned being too much work is simply the only answer...just to put some closure on this. Or, if I can find a way, I'll withdraw the question. Thanks rqmedes for trying...I'd actually forgotten all about this question until I got your response
:)