Skip to content

Commit

Permalink
Merge pull request #1 from chaowlert/master
Browse files Browse the repository at this point in the history
fix content contain multiple images
  • Loading branch information
whxaxes committed Jul 1, 2017
2 parents a53769e + 0806bb4 commit a1a92c1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ module.exports = function(opt) {
var str = String(file.contents);
var p = file.path.substring(0, file.path.lastIndexOf(path.sep));

str = str.replace(URL_REG, function(m) {
var prefix = RegExp.$1; //$1为匹配的开头的'或'或(
var suffix = RegExp.$4; //$4为匹配的结尾的'或'或)
var imgkind = RegExp.$3; //$3为匹配的图片类型
var imgPath = RegExp.$2; //$2为路径内容
str = str.replace(URL_REG, function(m, p1, p2, p3, p4) {
var prefix = p1; //$1为匹配的开头的'或'或(
var suffix = p4; //$4为匹配的结尾的'或'或)
var imgkind = p3; //$3为匹配的图片类型
var imgPath = p2; //$2为路径内容

//判断ignore的值并进行相应处理
if (igReg && m.match(igReg)) return m;
Expand Down

0 comments on commit a1a92c1

Please sign in to comment.