wangeditor v5 自定义html样式

Wangeditor自定义样式及Vue3中的代码高亮实现,
本文介绍了如何在Wangeditor的基础上自定义HTML样式,并提到在Vue3项目中使用Prism插件实现代码高亮的方法,适合非前端开发者参考。
部署运行你感兴趣的模型镜像

由于wangeditor的设计,保存下来的html是无样式的,需要自己自定义,下面给出本人的自定义样式供参考(在官网的基础上进行改进) 

.editor-content-view {
    /*不需要border*/
    /*border: 3px solid #ccc;*/
    /*border-radius: 5px;*/
    padding: 0 10px;
    margin-top: 20px;
    overflow-x: auto;
}

.editor-content-view a {
    color: #0269c8;
    cursor: pointer;
}

.editor-content-view p,
.editor-content-view li {
    white-space: pre-wrap; /* 保留空格 */
    margin: 15px 0;
}

.editor-content-view p {
    line-height: 1.5;
}

.editor-content-view blockquote {
    border-left: 8px solid #d0e5f2;
    padding: 10px 10px;
    margin: 15px 0;
    background-color: #f1f1f1;
}

/*.editor-content-view code {*/
/*  font-family: monospace;*/
/*  background-color: #eee;*/
/*  padding: 3px;*/
/*  border-radius: 3px;*/
/*}*/
/*.editor-content-view pre>code {*/
/*  display: block;*/
/*  padding: 10px;*/
/*}*/

.editor-content-view table {
    border-collapse: collapse;
    margin: 15px 0;
}

.editor-content-view td,
.editor-content-view th {
    border: 1px solid #ccc;
    min-width: 50px;
    height: 20px;
}

.editor-content-view th {
    background-color: #f1f1f1;
}

.editor-content-view ul,
.editor-content-view ol {
    padding-left: 20px;
}

.editor-content-view ul {
    list-style: disc
}


.editor-content-view ol {
    list-style: decimal;
}

.editor-content-view input[type="checkbox"] {
    margin-right: 5px;
}

不是专业写前端的,若有写的不好的请见谅

代码高亮功能,根据官网下载Prism这个插件即可,参考:

vue3中使用prismjs或者highlight.js实现代码高亮_vue3 代码高亮-优快云博客

您可能感兴趣的与本文相关的镜像

Wan2.2-T2V-A5B

Wan2.2-T2V-A5B

文生视频
Wan2.2

Wan2.2是由通义万相开源高效文本到视频生成模型,是有​50亿参数的轻量级视频生成模型,专为快速内容创作优化。支持480P视频生成,具备优秀的时序连贯性和运动推理能力

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值