1
1
Blackfriday
2
- [ ![ Build Status] [ BuildSVG ]] [ BuildURL ]
3
- [ ![ Godoc ] [ GodocV2SVG ]] [ GodocV2URL ]
2
+ [ ![ Build Status] [ BuildV2SVG ]] [ BuildV2URL ]
3
+ [ ![ PkgGoDev ] [ PkgGoDevV2SVG ]] [ PkgGoDevV2URL ]
4
4
===========
5
5
6
6
Blackfriday is a [ Markdown] [ 1 ] processor implemented in [ Go] [ 2 ] . It
@@ -18,12 +18,21 @@ It started as a translation from C of [Sundown][3].
18
18
Installation
19
19
------------
20
20
21
- Blackfriday is compatible with any modern Go release. With Go and git installed:
21
+ Blackfriday is compatible with modern Go releases in module mode.
22
+ With Go installed:
22
23
23
- go get -u gopkg.in /russross/blackfriday.v2
24
+ go get github.com /russross/blackfriday
24
25
25
- will download, compile, and install the package into your ` $GOPATH ` directory
26
- hierarchy.
26
+ will resolve and add the package to the current development module,
27
+ then build and install it. Alternatively, you can achieve the same
28
+ if you import it in a package:
29
+
30
+ import "github.com/russross/blackfriday"
31
+
32
+ and ` go get ` without parameters.
33
+
34
+ Old versions of Go and legacy GOPATH mode might work,
35
+ but no effort is made to keep them working.
27
36
28
37
29
38
Versions
@@ -32,13 +41,9 @@ Versions
32
41
Currently maintained and recommended version of Blackfriday is ` v2 ` . It's being
33
42
developed on its own branch: https://github.com/russross/blackfriday/tree/v2 and the
34
43
documentation is available at
35
- https://godoc.org/gopkg.in /russross/blackfriday. v2 .
44
+ https://pkg.go.dev/github.com /russross/blackfriday/ v2 .
36
45
37
- It is ` go get ` -able via [ gopkg.in] [ 6 ] at ` gopkg.in/russross/blackfriday.v2 ` ,
38
- but we highly recommend using package management tool like [ dep] [ 7 ] or
39
- [ Glide] [ 8 ] and make use of semantic versioning. With package management you
40
- should import ` github.com/russross/blackfriday ` and specify that you're using
41
- version 2.0.0.
46
+ It is ` go get ` -able in module mode at ` github.com/russross/blackfriday/v2 ` .
42
47
43
48
Version 2 offers a number of improvements over v1:
44
49
@@ -60,22 +65,7 @@ Potential drawbacks:
60
65
61
66
If you are still interested in the legacy ` v1 ` , you can import it from
62
67
` github.com/russross/blackfriday ` . Documentation for the legacy v1 can be found
63
- here: https://godoc.org/github.com/russross/blackfriday
64
-
65
- ### Known issue with ` dep `
66
-
67
- There is a known problem with using Blackfriday v1 _ transitively_ and ` dep ` .
68
- Currently ` dep ` prioritizes semver versions over anything else, and picks the
69
- latest one, plus it does not apply a ` [[constraint]] ` specifier to transitively
70
- pulled in packages. So if you're using something that uses Blackfriday v1, but
71
- that something does not use ` dep ` yet, you will get Blackfriday v2 pulled in and
72
- your first dependency will fail to build.
73
-
74
- There are couple of fixes for it, documented here:
75
- https://github.com/golang/dep/blob/master/docs/FAQ.md#how-do-i-constrain-a-transitive-dependencys-version
76
-
77
- Meanwhile, ` dep ` team is working on a more general solution to the constraints
78
- on transitive dependencies problem: https://github.com/golang/dep/issues/1124 .
68
+ here: https://pkg.go.dev/github.com/russross/blackfriday .
79
69
80
70
81
71
Usage
@@ -125,7 +115,7 @@ Here's an example of simple usage of Blackfriday together with Bluemonday:
125
115
``` go
126
116
import (
127
117
" github.com/microcosm-cc/bluemonday"
128
- " gopkg.in /russross/blackfriday.v2 "
118
+ " github.com /russross/blackfriday"
129
119
)
130
120
131
121
// ...
@@ -175,12 +165,12 @@ anchors for headings when `EXTENSION_AUTO_HEADER_IDS` is enabled. The
175
165
algorithm has a specification, so that other packages can create
176
166
compatible anchor names and links to those anchors.
177
167
178
- The specification is located at https://godoc.org /github.com/russross/blackfriday#hdr-Sanitized_Anchor_Names .
168
+ The specification is located at https://pkg.go.dev /github.com/russross/blackfriday#hdr-Sanitized_Anchor_Names .
179
169
180
- [ ` SanitizedAnchorName ` ] ( https://godoc.org /github.com/russross/blackfriday#SanitizedAnchorName ) exposes this functionality, and can be used to
170
+ [ ` SanitizedAnchorName ` ] ( https://pkg.go.dev /github.com/russross/blackfriday#SanitizedAnchorName ) exposes this functionality, and can be used to
181
171
create compatible links to the anchor names generated by blackfriday.
182
172
This algorithm is also implemented in a small standalone package at
183
- [ ` github.com/shurcooL/sanitized_anchor_name ` ] ( https://godoc.org /github.com/shurcooL/sanitized_anchor_name ) . It can be useful for clients
173
+ [ ` github.com/shurcooL/sanitized_anchor_name ` ] ( https://pkg.go.dev /github.com/shurcooL/sanitized_anchor_name ) . It can be useful for clients
184
174
that want a small package and don't need full functionality of blackfriday.
185
175
186
176
@@ -250,7 +240,7 @@ implements the following extensions:
250
240
and supply a language (to make syntax highlighting simple). Just
251
241
mark it like this:
252
242
253
- ``` go
243
+ ```go
254
244
func getTrue() bool {
255
245
return true
256
246
}
@@ -262,7 +252,7 @@ implements the following extensions:
262
252
To preserve classes of fenced code blocks while using the bluemonday
263
253
HTML sanitizer, use the following policy:
264
254
265
- ``` go
255
+ ```go
266
256
p := bluemonday.UGCPolicy()
267
257
p.AllowAttrs("class").Matching(regexp.MustCompile("^language-[a-zA-Z0-9]+$")).OnElements("code")
268
258
html := p.SanitizeBytes(unsafe)
@@ -273,7 +263,7 @@ implements the following extensions:
273
263
274
264
Cat
275
265
: Fluffy animal everyone likes
276
-
266
+
277
267
Internet
278
268
: Vector of transmission for pictures of cats
279
269
@@ -284,7 +274,7 @@ implements the following extensions:
284
274
end of the document. A footnote looks like this:
285
275
286
276
This is a footnote.[^1]
287
-
277
+
288
278
[^1]: the footnote text.
289
279
290
280
* **Autolinking**. Blackfriday can find URLs that have not been
@@ -321,7 +311,7 @@ Other renderers
321
311
Blackfriday is structured to allow alternative rendering engines. Here
322
312
are a few of note:
323
313
324
- * [github_flavored_markdown](https://godoc.org /github.com/shurcooL/github_flavored_markdown):
314
+ * [github_flavored_markdown](https://pkg.go.dev /github.com/shurcooL/github_flavored_markdown):
325
315
provides a GitHub Flavored Markdown renderer with fenced code block
326
316
highlighting, clickable heading anchor links.
327
317
@@ -341,6 +331,10 @@ are a few of note:
341
331
provides a drop-in renderer ready to use with Blackfriday, as well as
342
332
options and means for further customization.
343
333
334
+ * [Blackfriday-Confluence](https://github.com/kentaro-m/blackfriday-confluence): provides a [Confluence Wiki Markup](https://confluence.atlassian.com/doc/confluence-wiki-markup-251003035.html) renderer.
335
+
336
+ * [Blackfriday-Slack](https://github.com/karriereat/blackfriday-slack): converts markdown to slack message style
337
+
344
338
345
339
TODO
346
340
----
@@ -361,13 +355,10 @@ License
361
355
[1]: https://daringfireball.net/projects/markdown/ "Markdown"
362
356
[2]: https://golang.org/ "Go Language"
363
357
[3]: https://github.com/vmg/sundown "Sundown"
364
- [4]: https://godoc.org/gopkg.in /russross/blackfriday. v2#Parse "Parse func"
358
+ [4]: https://pkg.go.dev/github.com /russross/blackfriday/ v2#Parse "Parse func"
365
359
[5]: https://github.com/microcosm-cc/bluemonday "Bluemonday"
366
- [6]: https://labix.org/gopkg.in "gopkg.in"
367
- [7]: https://github.com/golang/dep/ "dep"
368
- [8]: https://github.com/Masterminds/glide "Glide"
369
-
370
- [BuildSVG]: https://travis-ci.org/russross/blackfriday.svg?branch=master
371
- [BuildURL]: https://travis-ci.org/russross/blackfriday
372
- [GodocV2SVG]: https://godoc.org/gopkg.in/russross/blackfriday.v2?status.svg
373
- [GodocV2URL]: https://godoc.org/gopkg.in/russross/blackfriday.v2
360
+
361
+ [BuildV2SVG]: https://travis-ci.org/russross/blackfriday.svg?branch=v2
362
+ [BuildV2URL]: https://travis-ci.org/russross/blackfriday
363
+ [PkgGoDevV2SVG]: https://pkg.go.dev/badge/github.com/russross/blackfriday/v2
364
+ [PkgGoDevV2URL]: https://pkg.go.dev/github.com/russross/blackfriday/v2
0 commit comments