javascript - ckeditor 将 html 实体显示为纯文本
问题描述
我已经将 ckeditor 与 php 一起使用,但它以纯文本形式显示 html 实体,例如换行符和锚标记。我已经看到其他链接并在 ckeditor 的配置中进行了更改,但它不起作用。
Hello,<br>Please join me <a href='https://.........'>link</a>
我的配置:
CKEDITOR.editorConfig = function (config) {
config.enterMode = CKEDITOR.ENTER_P;
config.language = 'es';
config.uiColor = '#F7B42C';
config.height = 300;
config.toolbarCanCollapse = true;
config.allowedContent = true;
config.entities = true;
config.ignoreEmptyParagraph = false;
};
CKEDITOR.replace('email_content');
解决方案
希望您直接显示该值。如果是这样,而不是使用@Html.Raw(value)
.
<textarea id="email_content" name="email_content">@Html.Raw(value)</textarea>
推荐阅读
- node.js - Firebase 云功能模拟器可以使用生产 Firestore 调用触发器吗?
- angular - 如何在 Angular 的服务中指定提供者?
- php - 使用 PHP 关联数组创建翻译类
- javascript - 定义的变量不会显示在窗口对象中
- html - Bootstrap 表行不适合 headerrow (Angular)
- android-studio - 当用户从另一个应用程序返回到我们的应用程序时如何做某事
- powerbi - 在列小计中获取正确的值
- geopandas - geopandas 光栅化 shpefile
- c# - Xamarin Forms CollectionView 无法正确显示
- python - 错误:子类化 `Model` 类时,您应该实现 `call` 方法。在 tensorflow 自定义模型上