Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

产品详情或文章详情页面,很多图片是后台编辑框插入的,已经带有src属性了,怎么改成data-original呢? #18

Open
chongyuan opened this issue Jun 15, 2017 · 2 comments

Comments

@chongyuan
Copy link

如果是图片列表页面,可以给img删除src属性然后加上data-original属性;
可是如果是后台编辑框插入的图片,这个怎样删除img的src属性呢?

@Webtyj
Copy link

Webtyj commented Jun 20, 2017

我是这样做的,用正则抓取img的src,换成了data-original,希望对你有用

@weijiatan456
Copy link

weijiatan456 commented Sep 8, 2018

我们是后台用正则$1,替换src为:
src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC' data-original

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants