编辑器内容展示
Posted 追风逐月
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了编辑器内容展示相关的知识,希望对你有一定的参考价值。
使用文本编辑器生成的文本前台展示时含有html标签,经过URL编码后,变成以%开头的字符串
以下方法可正确展示内容:
@if(Model.Content.IndexOf(‘%‘) == 0) { <script type="text/javascript"> document.write(decodeURIComponent("@(Model.Content)")); </script> } else { @html.Raw(Model.Content) }
以上是关于编辑器内容展示的主要内容,如果未能解决你的问题,请参考以下文章
Azure 机器人微软Azure Bot 编辑器系列 : 机器人/用户提问回答模式,机器人从API获取响应并组织答案 (The Bot Framework Composer tutorial(代码片段