当前位置:网站首页>文字编辑器 希望有错误的句子用红色标红,文字编辑器用了markdown
文字编辑器 希望有错误的句子用红色标红,文字编辑器用了markdown
2022-07-02 17:04:00 【呜呜艾伦】
文字编辑器 希望有错误的句子用红色标红,文字编辑器用了markdown
富文本有点难搞

<div class="markDownBlock">
<Markdown @on-ready="onReadyMarkdown" v-model="allQues"></Markdown>
<!-- @on-ready="onReadyMarkdown"-->
<Markdown isPreview="true" class="topMarkDown" v-model="errorContent"></Markdown>
<!-- <Markdown class="topMarkDown" v-model="changedContent"></Markdown>-->
</div>
两个markdown 一个用来预览 position: absolute; 放在编辑器的上层 靠右侧,遮盖住原本的编辑器预览
显示的那个要拿到 编辑的值,然后把错误的句子标红
.markDownBlock{
position: relative;
}
.topMarkDown{
position: absolute;
top: 0;
/*left: ;*/
right: 0;
width: 50%;
}
解析的时候 查看有没有重复的
parse () {
// let res= QuestionParser.getEachSub(this.allQues)
let res = QuestionParser.parseQues(this.allQues)
console.log(res)
this.errorHappen = false
this.parsedQuesList = res
// this.parsedQuesList.
this.errorContent = this.allQues
for (let o of this.parsedQuesList) {
// shortTitle
let parsedDataTrimed = o.title.trim()
for (let dbData of this.allQuesListDb) {
if (dbData == null) {
continue
}
let shortTitle = dbData.shortTitle
if (shortTitle == null) {
console.log('没有标题')
console.log('dbData')
console.log(dbData)
continue
}
let shortTitleDbTrimed = dbData.shortTitle.trim()
// let parsedDataTrimed= o.title.trim()
if (shortTitleDbTrimed == parsedDataTrimed) {
console.log('有一样的 ')
console.log('数据库里的 ')
console.log(shortTitleDbTrimed)
console.log('现在解析的')
console.log(parsedDataTrimed)
this.errorHappen = true
// this.allQues=this.allQues.replace(shortTitleDbTrimed,
// '<span style=\'color: red;\' >' + shortTitleDbTrimed + '</span>')
this.errorContent = this.errorContent.replace(shortTitleDbTrimed,
'<span style=\'color: red;\' >' + shortTitleDbTrimed + '</span>')
}
}
}
},
边栏推荐
- Esp32-c3 introductory tutorial question ⑩ - error: implicit declaration of function 'ESP_ blufi_ close‘;
- Mysql 备份的三种方式
- Interview, about thread pool
- 阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了
- Wechat applet video sharing platform system graduation design completion (1) development outline
- Three methods of MySQL backup
- Unity学习shader笔记[八十二]增强单通道颜色渲染的黑白处理
- 再放宽!这些应届生,可直接落户上海
- 1.5.1版本官方docker镜像运行容器,能设置使用 mysql 8驱动吗?
- 服务器php环境搭建教程,PHP服务端环境搭建图文详解
猜你喜欢

ESP32-C3入门教程 问题篇⑩——error: implicit declaration of function ‘esp_blufi_close‘;

Qt官方示例:Qt Quick Controls - Gallery

微信小程序视频分享平台系统毕业设计毕设(4)开题报告

Another double non reform exam 408, will it be cold? Software College of Nanchang Aviation University

再放宽!这些应届生,可直接落户上海

Nvidia 显卡 Failed to initialize NVML Driver/library version mismatch 错误解决方案

UE4 draw a circle with spline

微信核酸检测预约小程序系统毕业设计毕设(4)开题报告

任职 22 年,PowerShell 之父将从微软离职:曾因开发 PowerShell 被微软降级过
![[Northwestern Polytechnic University] information sharing of the first and second postgraduate examinations](/img/15/298ea6f7367741e1e085007c498e51.jpg)
[Northwestern Polytechnic University] information sharing of the first and second postgraduate examinations
随机推荐
Qt Official examples: Qt Quick Controls - Gallery
Relax again! These fresh students can settle directly in Shanghai
夜神模擬器+Fiddler抓包測試App
再放寬!這些應届生,可直接落戶上海
Chrome 正式支持 MathML,默认在 Chromium Dev 105 中启用
27:第三章:开发通行证服务:10:【注册/登录】接口:注册/登录OK后,把用户会话信息(uid,utoken)保存到redis和cookie中;(一个主要的点:设置cookie)
win10 卸载cuda
Customize a loading instruction
UE4 用spline畫正圓
719. 找出第 K 小的数对距离
Rte11 interrupt decoupling function
Wechat nucleic acid detection appointment applet system graduation design completion (4) opening report
微信核酸检测预约小程序系统毕业设计毕设(5)任务书
夜神模拟器+Fiddler抓包测试App
Tower safety monitoring system unattended inclination vibration monitoring system
cJSON 使用详解
Redis(6)----对象与数据结构
[Northwestern Polytechnic University] information sharing of the first and second postgraduate examinations
国金证券是国企吗?在国金证券开户资金安全吗?
Wechat nucleic acid detection appointment applet system graduation design (2) applet function