Merge 1bdf44756d
into acedacffef
commit
e724ba1d49
18
README.md
18
README.md
|
@ -13,6 +13,22 @@ extensions.
|
|||
It started as a translation from C of [Sundown][3].
|
||||
|
||||
|
||||
About Duzy's fork
|
||||
-----------------
|
||||
|
||||
The original Blackfirday can not process [empty links][empty-link-issue].
|
||||
Empty links could be very useful for holding meta information to be
|
||||
processed by application. For example:
|
||||
|
||||
``` markdown
|
||||
[](
|
||||
anything goes here should be ignored by renderer as the link is empty
|
||||
)
|
||||
```
|
||||
|
||||
In Duzy's fork, the parsing issue of empty links was fixed. Other possible
|
||||
modification may happen if needed and differs from the original version.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
|
@ -308,3 +324,5 @@ License
|
|||
[4]: https://godoc.org/gopkg.in/russross/blackfriday.v2#Parse "Parse func"
|
||||
[5]: https://github.com/microcosm-cc/bluemonday "Bluemonday"
|
||||
[6]: https://labix.org/gopkg.in "gopkg.in"
|
||||
|
||||
[empty-link-issue]: https://github.com/russross/blackfriday/pull/402
|
||||
|
|
2
go.mod
2
go.mod
|
@ -1 +1 @@
|
|||
module github.com/russross/blackfriday/v2
|
||||
module github.com/duzy/blackfriday
|
||||
|
|
|
@ -541,7 +541,9 @@ func link(p *Markdown, data []byte, offset int) (int, *Node) {
|
|||
|
||||
// links need something to click on and somewhere to go
|
||||
if len(uLink) == 0 || (t == linkNormal && txtE <= 1) {
|
||||
return 0, nil
|
||||
if txtE == 1 && p.extensions&EmptyLink == 0 {
|
||||
return 0, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,13 +47,14 @@ const (
|
|||
AutoHeadingIDs // Create the heading ID from the text
|
||||
BackslashLineBreak // Translate trailing backslashes into line breaks
|
||||
DefinitionLists // Render definition lists
|
||||
EmptyLink // Parse empty links
|
||||
|
||||
CommonHTMLFlags HTMLFlags = UseXHTML | Smartypants |
|
||||
SmartypantsFractions | SmartypantsDashes | SmartypantsLatexDashes
|
||||
|
||||
CommonExtensions Extensions = NoIntraEmphasis | Tables | FencedCode |
|
||||
Autolink | Strikethrough | SpaceHeadings | HeadingIDs |
|
||||
BackslashLineBreak | DefinitionLists
|
||||
BackslashLineBreak | DefinitionLists | EmptyLink
|
||||
)
|
||||
|
||||
// ListType contains bitwise or'ed flags for list and list item objects.
|
||||
|
|
Loading…
Reference in New Issue