[Asp.Net Core] - 设置 Syncfusion / RichTextEditor 移除超链接及高度自适应 的方法

背景

使用 Syncfusion / RichTextEditor 对录入后的信息进行展示:
1. 希望内容高度自适应。
2. 希望禁用原文中的超链接。

 

实现

复制代码
<div class="form-group row">
    <div class="col-12">
        <label class="font-weight-bold">详细内容</label>
        <div>
            <ej-rte id="Extend" width="100%"allow-editing="false" show-toolbar="false" value="@Model.Extend"></ej-rte>
        </div>
    </div>
</div>

@section Scripts {
    <script>
        $(function () {
            /* Remove ALL Hyperlinks */
            $('#Extend_Iframe').contents().find('a').contents().unwrap();
            /* Refresh Iframe Heights */
            var iframeHeight = $('#Extend_Iframe').contents().height();
            $('#Extend_wrapper').height(iframeHeight + 24);
            $('#Extend_Iframe').height(iframeHeight + 12);
        });
    </script>
}
复制代码

 

录入页面

 

浏览页面

 参考资料

https://help.syncfusion.com/aspnet-core/richtexteditor/working-with-content
http://api.jquery.com/unwrap/

posted @   jinzesudawei  阅读(409)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
点击右上角即可分享
微信分享提示