首页 > 解决方案 > 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');

标签: javascriptphpjqueryhtmlckeditor

解决方案


希望您直接显示该值。如果是这样,而不是使用@Html.Raw(value).

<textarea id="email_content" name="email_content">@Html.Raw(value)</textarea>

推荐阅读