mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
Merge pull request #323 from russross/ditch-skip-style
Ditch SkipStyle flag
This commit is contained in:
commit
3d1baecb3d
8
html.go
8
html.go
|
@ -31,7 +31,6 @@ type HTMLFlags int
|
|||
const (
|
||||
HTMLFlagsNone HTMLFlags = 0
|
||||
SkipHTML HTMLFlags = 1 << iota // Skip preformatted HTML blocks
|
||||
SkipStyle // Skip embedded <style> elements
|
||||
SkipImages // Skip embedded images
|
||||
SkipLinks // Skip all links
|
||||
Safelink // Only link to trusted protocols
|
||||
|
@ -444,14 +443,7 @@ func (r *HTMLRenderer) RenderNode(w io.Writer, node *Node, entering bool) WalkSt
|
|||
if r.Flags&SkipHTML != 0 {
|
||||
break
|
||||
}
|
||||
if r.Flags&SkipStyle != 0 && isHTMLTag(node.Literal, "style") {
|
||||
break
|
||||
}
|
||||
//if options.safe {
|
||||
// out(w, "<!-- raw HTML omitted -->")
|
||||
//} else {
|
||||
r.out(w, node.Literal)
|
||||
//}
|
||||
case Link:
|
||||
// mark it but don't link it if it is not a safe link: no smartypants
|
||||
dest := node.LinkData.Destination
|
||||
|
|
|
@ -1119,15 +1119,6 @@ func TestSkipImages(t *testing.T) {
|
|||
})
|
||||
}
|
||||
|
||||
func TestSkipStyle(t *testing.T) {
|
||||
doTestsInlineParam(t, []string{
|
||||
"foo\n\n<style>color: #f00</style> bar",
|
||||
"<p>foo</p>\n\n<p>color: #f00 bar</p>\n",
|
||||
}, TestParams{
|
||||
HTMLFlags: SkipStyle,
|
||||
})
|
||||
}
|
||||
|
||||
func TestUseXHTML(t *testing.T) {
|
||||
doTestsParam(t, []string{
|
||||
"---",
|
||||
|
|
Loading…
Reference in New Issue
Block a user