Skip to content
Permalink
Browse files

Use github version of blackfriday/v2 and remove dep files

The blackfriday gopkg.in release is broken when using `go mod vendor`
and building a project dependent on bfchroma with `go build -mod=vendor`
and `go version go1.12.2 gccgo (GCC) 9.2.0 linux/amd64`.

The build fails with:

goroutine 1 [running]:
runtime..z2fdebug.Stack
	/build/gcc/src/gcc/libgo/go/runtime/debug/stack.go:24
runtime..z2fdebug.PrintStack
	/build/gcc/src/gcc/libgo/go/runtime/debug/stack.go:16
main.main
	:0
build derpderp: cannot find module for path github.com/shurcooL/sanitized_anchor_name

Fix this by pointing to the github.com release of blackfriday instead in
bfchroma's go.mod. Take this opportunity to also remove remaining dep
files. Another benefit is that the `replace` directive in go.mod to
workaround some blackfriday release confusion is no longer required
(neither in bfchroma nor in any packages using bfchroma).

Signed-off-by: Christopher M. Riedl <cmr@informatik.wtf>
  • Loading branch information
cmr-informatik committed Oct 11, 2019
1 parent b3ac81f commit a92e7ad00e8e0bcf0016718cf79903723389915d
Showing with 9 additions and 151 deletions.
  1. +0 −90 Gopkg.lock
  2. +0 −42 Gopkg.toml
  3. +5 −13 README.md
  4. +1 −1 example/main.go
  5. +1 −3 go.mod
  6. +1 −1 renderer.go
  7. +1 −1 renderer_test.go

This file was deleted.

This file was deleted.

@@ -19,21 +19,13 @@ a [Blackfriday](https://github.com/russross/blackfriday) renderer.
## Install and prerequisites

This project requires and uses the `v2` version of
[Blackfriday](https://github.com/russross/blackfriday/tree/v2). After
[this issue](https://github.com/Depado/bfchroma/issues/3) I decided to rollback
to the `gopkg.in` version so the lib can be go gettable.
[Blackfriday](https://github.com/russross/blackfriday/tree/v2).

```
$ go get -u github.com/Depado/bfchroma
```

You can also install it directly by using dep in your project:

```
$ dep ensure -add github.com/Depado/bfchroma
```

_Additionnaly, this project uses the module approach of go 1.11_
_This project uses the module approach of go 1.11_

## Features

@@ -111,7 +103,7 @@ import (
"github.com/Depado/bfchroma"
bf "gopkg.in/russross/blackfriday.v2"
bf "github.com/russross/blackfriday/v2"
)
var md = "This is some sample code.\n\n```go\n" +
@@ -149,7 +141,7 @@ package main
import (
"github.com/Depado/bfchroma"
"github.com/alecthomas/chroma/formatters/html"
bf "github.com/russross/blackfriday"
bf "github.com/russross/blackfriday/v2"
)
// Defines the extensions that are used
@@ -212,4 +204,4 @@ bf.Run(input, bf.WithRenderer(r), bf.WithExtensions(exts))
```

This way, you can pass your `css` var to any template and render it along the
rendered markdown.
rendered markdown.
@@ -6,7 +6,7 @@ import (
"github.com/Depado/bfchroma"
"github.com/alecthomas/chroma/formatters/html"

bf "gopkg.in/russross/blackfriday.v2"
bf "github.com/russross/blackfriday/v2"
)

var md = "This is some sample code.\n\n```go\n" +
4 go.mod
@@ -10,11 +10,9 @@ require (
github.com/dlclark/regexp2 v1.1.6 // indirect
github.com/mattn/go-isatty v0.0.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.0.1
github.com/sergi/go-diff v1.0.0 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/stretchr/testify v1.2.2
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8 // indirect
gopkg.in/russross/blackfriday.v2 v2.0.1
)

replace gopkg.in/russross/blackfriday.v2 => github.com/russross/blackfriday/v2 v2.0.1
@@ -9,7 +9,7 @@ import (
"github.com/alecthomas/chroma/formatters/html"
"github.com/alecthomas/chroma/lexers"
"github.com/alecthomas/chroma/styles"
bf "gopkg.in/russross/blackfriday.v2"
bf "github.com/russross/blackfriday/v2"
)

// Option defines the functional option type
@@ -9,7 +9,7 @@ import (
"github.com/alecthomas/chroma/formatters/html"
"github.com/alecthomas/chroma/styles"
"github.com/stretchr/testify/assert"
bf "gopkg.in/russross/blackfriday.v2"
bf "github.com/russross/blackfriday/v2"
)

func TestExtend(t *testing.T) {

0 comments on commit a92e7ad

Please sign in to comment.
You can’t perform that action at this time.