1
0
mirror of https://github.com/danog/blackfriday.git synced 2024-11-26 20:14:43 +01:00

Merge pull request #323 from russross/ditch-skip-style

Ditch SkipStyle flag
This commit is contained in:
Vytautas Šaltenis 2016-12-07 21:00:43 +02:00 committed by GitHub
commit 3d1baecb3d
2 changed files with 0 additions and 17 deletions

View File

@ -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

View File

@ -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{
"---",