File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,13 @@ package main
22
33import (
44 "fmt"
5- "github.com/fairlyblank/md2min"
65 "io/ioutil"
76 "os"
87 "path/filepath"
98 "regexp"
109 "strings"
10+
11+ "github.com/fairlyblank/md2min"
1112)
1213
1314// 定义一个访问者结构体
@@ -50,6 +51,9 @@ func (self *Visitor) md2html(arg map[string]string) error {
5051 // 删除页面链接
5152 input = RemoveFooterLink (input )
5253
54+ // remove image suffix
55+ input = RemoveImageLinkSuffix (input )
56+
5357 var out * os.File
5458 filename := strings .Replace (f .Name (), ".md" , ".html" , - 1 )
5559 fmt .Println (to + "/" + filename )
@@ -85,6 +89,11 @@ func RemoveFooterLink(input string) string {
8589 return re_footer .ReplaceAllString (input , "" )
8690}
8791
92+ func RemoveImageLinkSuffix (input string ) string {
93+ re_footer := regexp .MustCompile (`png\?raw=true` )
94+ return re_footer .ReplaceAllString (input , "png" )
95+ }
96+
8897func main () {
8998 tmp := os .Getenv ("TMP" )
9099 if tmp == "" {
You can’t perform that action at this time.
0 commit comments