mirror of
https://github.com/gohugoio/hugo.git
synced 2025-05-01 08:00:05 +03:00
Apply project wide go fmt
This commit is contained in:
parent
c274e21356
commit
72f14a8202
8 changed files with 28 additions and 29 deletions
|
@ -4,9 +4,9 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"html"
|
"html"
|
||||||
|
|
||||||
|
"github.com/miekg/mmark"
|
||||||
"github.com/russross/blackfriday"
|
"github.com/russross/blackfriday"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"github.com/miekg/mmark"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Wraps a blackfriday.Renderer, typically a blackfriday.Html
|
// Wraps a blackfriday.Renderer, typically a blackfriday.Html
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
package helpers
|
package helpers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
|
||||||
"github.com/spf13/viper"
|
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Renders a codeblock using Blackfriday
|
// Renders a codeblock using Blackfriday
|
||||||
func render(input string) string {
|
func render(input string) string {
|
||||||
ctx := &RenderingContext{};
|
ctx := &RenderingContext{}
|
||||||
render := GetHTMLRenderer(0, ctx);
|
render := GetHTMLRenderer(0, ctx)
|
||||||
|
|
||||||
buf := &bytes.Buffer{}
|
buf := &bytes.Buffer{}
|
||||||
render.BlockCode(buf, []byte(input), "html")
|
render.BlockCode(buf, []byte(input), "html")
|
||||||
|
@ -17,15 +18,14 @@ func render(input string) string {
|
||||||
|
|
||||||
// Renders a codeblock using Mmark
|
// Renders a codeblock using Mmark
|
||||||
func renderWithMmark(input string) string {
|
func renderWithMmark(input string) string {
|
||||||
ctx := &RenderingContext{};
|
ctx := &RenderingContext{}
|
||||||
render := GetMmarkHtmlRenderer(0, ctx);
|
render := GetMmarkHtmlRenderer(0, ctx)
|
||||||
|
|
||||||
buf := &bytes.Buffer{}
|
buf := &bytes.Buffer{}
|
||||||
render.BlockCode(buf, []byte(input), "html", []byte(""), false, false)
|
render.BlockCode(buf, []byte(input), "html", []byte(""), false, false)
|
||||||
return buf.String()
|
return buf.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func TestCodeFence(t *testing.T) {
|
func TestCodeFence(t *testing.T) {
|
||||||
|
|
||||||
if !HasPygments() {
|
if !HasPygments() {
|
||||||
|
|
|
@ -347,7 +347,6 @@ func TestDictionary(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func TestIn(t *testing.T) {
|
func TestIn(t *testing.T) {
|
||||||
for i, this := range []struct {
|
for i, this := range []struct {
|
||||||
v1 interface{}
|
v1 interface{}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue