当前位置:网站首页>文字编辑器 希望有错误的句子用红色标红,文字编辑器用了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>')
}
}
}
},
边栏推荐
- Concepts and differences of PR curve and ROC curve
- UE4 用spline画正圆
- “栈”的典型应用—表达式求值(C语言实现)
- 消除IBM P750小机上的黄色报警灯[通俗易懂]
- Deep neural network Summary
- 巴比特 | 元宇宙每日必读:一千块就能买一个虚拟主播?这是小企业的直播福音还是在“割韭菜”?...
- Wechat applet video sharing platform system graduation design (3) background function
- 快速排序基本思路(通俗易懂+例子)「建议收藏」
- Interview, about thread pool
- Matlab中弧度转角度、角度转弧度
猜你喜欢

SteamOS 3.3 Beta 发布,Steam Deck 中文键盘终于来了

Leetcode interview question 16.11 Diving board

微信小程序视频分享平台系统毕业设计毕设(2)小程序功能

Ue4 dessine un cercle avec une ligne de contour

Wechat nucleic acid detection and appointment applet system graduation design (3) background function

Qt官方示例:Qt Quick Controls - Gallery

Wechat applet video sharing platform system graduation design completion (5) assignment

拿起相机,便是最好的艺术疗愈

27:第三章:开发通行证服务:10:【注册/登录】接口:注册/登录OK后,把用户会话信息(uid,utoken)保存到redis和cookie中;(一个主要的点:设置cookie)

Nvidia 显卡 Failed to initialize NVML Driver/library version mismatch 错误解决方案
随机推荐
Leetcode 面试题 17.01. 不用加号的加法
NM02-独立于总线协议的NM模块调用序列图及代码解释
Memory mapping of QT
Architecture design - ID generator "suggestions collection"
Enter a valid user name and password in the Microsoft LDAP configuration page, and enter a valid user name in the Microsoft LDAP configuration page
微信核酸检测预约小程序系统毕业设计毕设(3)后台功能
Win10 uninstall CUDA
Implementation shadow introduction
Wechat nucleic acid detection appointment applet system graduation design completion (1) development outline
Détends - toi encore! Ces nouveaux étudiants peuvent s'installer directement à Shanghai
Wechat nucleic acid detection appointment applet system graduation design completion (4) opening report
面试,关于线程池的那些事
iframe嵌套详解
阿里三面被面试官狂问Redis,简历上再也不敢写'精通'了
服务器php环境搭建教程,PHP服务端环境搭建图文详解
Vi/vim delete: one line, one character, word, the first character of each line command
Summary of fun free GM games
巴比特 | 元宇宙每日必读:一千块就能买一个虚拟主播?这是小企业的直播福音还是在“割韭菜”?...
Wechat applet video sharing platform system graduation design completion (6) opening defense ppt
Wechat applet video sharing platform system graduation design (3) background function