From 8dfe501b76e338b0005bc891b1f51a456c2ad814 Mon Sep 17 00:00:00 2001 From: woooha Date: Tue, 16 Oct 2012 17:22:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E6=9C=80=E7=BB=88?= =?UTF-8?q?=E7=94=9F=E6=88=90=E7=9A=84=20html=20=E4=B8=AD=E6=89=80?= =?UTF-8?q?=E6=9C=89=E8=B6=85=E9=93=BE=E6=8E=A5=E4=BB=8D=E7=84=B6=E4=B8=BA?= =?UTF-8?q?=20.md=20=E5=BD=A2=E5=BC=8F=E7=9A=84=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.go b/build.go index 26a7a7c3..12eb1f30 100644 --- a/build.go +++ b/build.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" "strings" + "regexp" ) // 定义一个访问者结构体 @@ -28,6 +29,7 @@ func (self *Visitor) visit(path string, f os.FileInfo, err error) error { return err } input, _ := ioutil.ReadAll(file) + input = regexp.MustCompile("\\[(.*?)\\]\\(?\\)").ReplaceAll(input, []byte("[$1](<$2.html>)")) output := blackfriday.MarkdownCommon(input) var out *os.File if out, err = os.Create(strings.Replace(f.Name(), ".md", ".html", -1)); err != nil {