当前位置:网站首页>文字编辑器 希望有错误的句子用红色标红,文字编辑器用了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>')
}
}
}
},
边栏推荐
- 【愚公系列】2022年07月 Go教学课程 001-Go语言前提简介
- 夜神模拟器+Fiddler抓包测试App
- 【西北工业大学】考研初试复试资料分享
- 链游系统开发(Unity3D链游开发详情)丨链游开发成熟技术源码
- Wechat applet video sharing platform system graduation design completion (8) graduation design thesis template
- Web chat tool
- NVIDIA graphics card failed to initialize nvml driver/library version mismatch error solution
- 实施阴影介绍
- Esp32-c3 introductory tutorial question ⑩ - error: implicit declaration of function 'ESP_ blufi_ close‘;
- 国金证券是国企吗?在国金证券开户资金安全吗?
猜你喜欢

再放寬!這些應届生,可直接落戶上海

能解决80%故障的排查思路

Leetcode 面试题 16.17. 连续数列

Nm01 function overview and API definition of nm module independent of bus protocol

微信核酸检测预约小程序系统毕业设计毕设(5)任务书

Troubleshooting ideas that can solve 80% of faults

揭秘得物客服IM全链路通信过程

Wechat applet video sharing platform system graduation design (3) background function

Leetcode interview question 16.11 Diving board

Wechat applet video sharing platform system graduation design completion (4) opening report
随机推荐
Three methods of MySQL backup
Leetcode 面试题 16.17. 连续数列
pycharm 修改 pep8 E501 line too long > 0 characters
Use dosbox to run the assembly super detailed step "suggestions collection"
Vi/vim delete: one line, one character, word, the first character of each line command
又一所双非改考408,会爆冷么?南昌航空大学软件学院
300+ documents! This article explains the latest progress of multimodal learning based on transformer
Leetcode interview question 16.15 Abacus wonderful calculation
【西北工业大学】考研初试复试资料分享
Qt官方示例:Qt Quick Controls - Gallery
Troubleshooting ideas that can solve 80% of faults
MySQL installation and configuration
Tower safety monitoring system unattended inclination vibration monitoring system
UE4 用spline画正圆
微信核酸检测预约小程序系统毕业设计毕设(1)开发概要
QQmlApplicationEngine
实施阴影介绍
【愚公系列】2022年07月 Go教学课程 001-Go语言前提简介
微信小程序视频分享平台系统毕业设计毕设(8)毕业设计论文模板
Detailed explanation of cjson usage