mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
Apply project wide go fmt
This commit is contained in:
@@ -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{}
|
||||||
|
Reference in New Issue
Block a user