当前位置:网站首页>文字编辑器 希望有错误的句子用红色标红,文字编辑器用了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>')
}
}
}
},
边栏推荐
- Leetcode 面试题 16.15. 珠玑妙算
- 【愚公系列】2022年07月 Go教学课程 001-Go语言前提简介
- Leetcode 面试题 17.01. 不用加号的加法
- 国金证券是国企吗?在国金证券开户资金安全吗?
- MySQL about only_ full_ group_ By limit
- 微信核酸检测预约小程序系统毕业设计毕设(5)任务书
- RTE11- 中断解耦功能
- 微信核酸检测预约小程序系统毕业设计毕设(4)开题报告
- Relax again! These fresh students can settle directly in Shanghai
- QT official example: QT quick controls - Gallery
猜你喜欢
Customize a loading instruction
1288_ Implementation analysis of vtask resume() interface and interrupt Security version interface in FreeRTOS
【西北工业大学】考研初试复试资料分享
微信核酸检测预约小程序系统毕业设计毕设(2)小程序功能
Nvidia 显卡 Failed to initialize NVML Driver/library version mismatch 错误解决方案
Pit encountered during installation of laravel frame
UE4 用spline画正圆
exness深度好文:动性系列-黄金流动性实例分析(五)
UE4 draw a circle with spline
微信核酸检测预约小程序系统毕业设计毕设(3)后台功能
随机推荐
iframe嵌套详解
Leetcode interview question 17.01 Addition without plus sign
Leetcode interview question 16.15 Abacus wonderful calculation
再放寬!這些應届生,可直接落戶上海
微信核酸检测预约小程序系统毕业设计毕设(2)小程序功能
Qt Official examples: Qt Quick Controls - Gallery
巴比特 | 元宇宙每日必读:一千块就能买一个虚拟主播?这是小企业的直播福音还是在“割韭菜”?...
Iframe nesting details
Implementation shadow introduction
Chrome 正式支持 MathML,默认在 Chromium Dev 105 中启用
QQmlApplicationEngine
阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了
exness深度好文:动性系列-黄金流动性实例分析(五)
1.5.1版本官方docker镜像运行容器,能设置使用 mysql 8驱动吗?
pycharm 修改 pep8 E501 line too long > 0 characters
C# 检测图片是否被旋转并修改到正真的旋转
Use dosbox to run the assembly super detailed step "suggestions collection"
微信核酸检测预约小程序系统毕业设计毕设(4)开题报告
Leetcode 面试题 16.11. 跳水板
Export Excel files using npoi