This commit is contained in:
kfcampbell 2020-03-20 16:15:41 -07:00
Родитель f7d08865e0
Коммит 04169cbf03
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -55,7 +55,7 @@ func TestNewHttpClient_OverrideURL(t *testing.T) {
assert.Equal(t, "example.com", r.Host)
})
c := newHttpClient(s.URL.String(), false, "")
c := newHTTPClient(s.URL.String(), false, "")
c.Get("https://example.com/override")
s.HandleFunc("/not-override", func(w http.ResponseWriter, r *http.Request) {
@ -63,7 +63,7 @@ func TestNewHttpClient_OverrideURL(t *testing.T) {
assert.Equal(t, s.URL.Host, r.Host)
})
c = newHttpClient("", false, "")
c = newHTTPClient("", false, "")
c.Get(fmt.Sprintf("%s/not-override", s.URL.String()))
}
@ -75,7 +75,7 @@ func TestNewHttpClient_UnixSocket(t *testing.T) {
s.HandleFunc("/unix-socket", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("unix-socket-works"))
})
c := newHttpClient("", false, sock)
c := newHTTPClient("", false, sock)
resp, err := c.Get(fmt.Sprintf("%s/unix-socket", s.URL.String()))
assert.Equal(t, nil, err)
result, _ := ioutil.ReadAll(resp.Body)

Просмотреть файл

@ -13,7 +13,7 @@ import (
// https://github.com/russross/blackfriday/blob/v2/markdown.go
const (
PARSER_EXTENSIONS = blackfriday.NoIntraEmphasis |
ParserExtensions = blackfriday.NoIntraEmphasis |
blackfriday.FencedCode |
blackfriday.SpaceHeadings |
blackfriday.AutoHeadingIDs |
@ -210,7 +210,7 @@ func Opt(buffer io.Writer, renderer blackfriday.Renderer) *renderOption {
}
func Generate(src []byte, opts ...*renderOption) {
parser := blackfriday.New(blackfriday.WithExtensions(PARSER_EXTENSIONS))
parser := blackfriday.New(blackfriday.WithExtensions(ParserExtensions))
ast := parser.Parse(sanitizeInput(src))
for _, opt := range opts {