Skip to content

Commit

Permalink
Fix img src parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
nocd5 committed Jan 10, 2019
1 parent ca55e60 commit 759b18a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func writeHtmlConcat(inputs []string, output string, embed, toc, mathjax bool, t
}

func embedImage(src, parent string) (string, error) {
re_find, err := regexp.Compile(`(<img[\S\s]+?src=")(\S+?)("[\S\s]*?/?>)`)
re_find, err := regexp.Compile(`(<img[\S\s]+?src=")([\S\s]+?)("[\S\s]*?/?>)`)
if err != nil {
return src, err
}
Expand Down Expand Up @@ -290,7 +290,7 @@ func embedImage(src, parent string) (string, error) {
}

func parseImageOpt(src string) (string, error) {
re, err := regexp.Compile(`(<img[\S\s]+?src=)"(\S+?)\?(\S+?)"([\S\s]*?/?>)`)
re, err := regexp.Compile(`(<img[\S\s]+?src=)"([\S\s]+?)\?(\S+?)"([\S\s]*?/?>)`)
if err != nil {
return src, err
}
Expand Down

0 comments on commit 759b18a

Please sign in to comment.