当前位置:网站首页>JS regular filtering and adding image prefixes in rich text
JS regular filtering and adding image prefixes in rich text
2022-07-06 02:49:00 【Residual temperature without trace】
1、 Filter image prefixes without '/', Become a relative path , The following two regularities are ok , Personal test
// Example , Filter image prefixes without '/', Become a relative path
console.log('valueHtml', valueHtml.replace(/https?:\/\/[^\/]*(\/)*/g, ''));
console.log('valueHtml', valueHtml.replace(/\bhttps?:\/\/(.*?)\/+/ig, ''));
2、 Add picture prefix
valueHtml= result.detail.content.replace(/<img [^>]*src=['"]/g, `<img src="${ Your domain name }`)
Reference material : Use regular expressions to add domain names to rich text image labels for display 、 Delete domain name submission _qq_43675010 The blog of -CSDN Blog
边栏推荐
- Prototype design
- Which ecology is better, such as Mi family, graffiti, hilink, zhiting, etc? Analysis of five mainstream smart brands
- Dachang image library
- Referenceerror: primordials is not defined error resolution
- MySQL learning notes-10-tablespace recycling
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22
- 【若依(ruoyi)】ztree 自定义图标(iconSkin 属性)
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
- 建模规范:命名规范
- GifCam v7.0 极简GIF动画录制工具中文单文件版
猜你喜欢

A copy can also produce flowers

1. Dynamic parameters of function: *args, **kwargs
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12](/img/b1/926d9b3d7ce9c5104f3e81974eef07.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12
![[matlab] access of variables and files](/img/cf/6f3cfdc4310fcf0bdcaa776d68261e.jpg)
[matlab] access of variables and files

深度解析链动2+1模式,颠覆传统卖货思维?

建模规范:命名规范

codeforces每日5题(均1700)-第六天
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14](/img/c5/dde92f887e8e73d7db869fcddc107f.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14

【Kubernetes 系列】一文學會Kubernetes Service安全的暴露應用

ReferenceError: primordials is not defined错误解决
随机推荐
[Yu Yue education] basic reference materials of digital electronic technology of Xi'an University of Technology
Solve 9 with C language × 9 Sudoku (personal test available) (thinking analysis)
Microsoft speech synthesis assistant v1.3 text to speech tool, real speech AI generator
Single instance mode of encapsulating PDO with PHP in spare time
【Unity3D】GUI控件
[postgraduate entrance examination English] prepare for 2023, learn list5 words
如何精准识别主数据?
Large scale DDoS attacks take Myanmar offline
[unity3d] GUI control
Thinking on Architecture Design (under continuous updating)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 23
【Kubernetes 系列】一文學會Kubernetes Service安全的暴露應用
[kubernetes series] learn the exposed application of kubernetes service security
华为、H3C、思科命令对比,思维导图形式从基础、交换、路由三大方向介绍【转自微信公众号网络技术联盟站】
RobotFramework入门(一)简要介绍及使用
Elimination games
PMP practice once a day | don't get lost in the exam -7.5
"Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.5 automatic differentiation_ Learning thinking and exercise answers
Pat 1046 shortest distance (20 points) simulation
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 14