You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Summernote字体遭Sanitizer拦截报错,请求技术解决方案

Summernote字体族被Sanitizer拦截问题

问题详情

使用Summernote时,其内置字体族被Sanitizer拦截,报错信息如下:

downloadable font: rejected by sanitizer (font-family: "summernote" style:normal weight:400 stretch:100 src index:2)

错误指向的CSS代码:

@font-face{font-family:"summernote";font-style:normal;font-weight:normal;src:url("./font/summernote.eot?4c7e83314b68cfa6a0d18a8b4690044b");src:url("./font/summernote.eot?4c7e83314b68cfa6a0d18a8b4690044b#iefix") format("embedded-opentype"),url("./font/summernote.woff?4c7e83314b68cfa6a0d18a8b4690044b") format("woff"),url("./font/summernote.ttf?4c7e83314b68cfa6a0d18a8b4690044b") format("truetype")}[class^="note-icon-"]:before,[class*=" note-icon-"]:before

具体错误出现在这段代码的TTF字体URL部分:

url("./font/summernote.ttf?4c7e83314b68cfa6a0d18a8b4690044b")

我找到了一些Font-awesome相关的解决方案,但不确定是否适用于当前Summernote字体族的问题。

我的Summernote调用代码

$('#description').summernote({
            toolbar: [],
            width: null,
            height: null,
            minHeight: 150,
            maxWidth: 400,
            focus: true,
            maxTextLength: 5000,
            disableDragAndDrop: true,
            popover: {
                image: [
                    ['remove', ['removeMedia']],
                ],
});

内容的提问来源于stack exchange,提问作者Mauro H. Delmondes

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.16 23:45:06