diff --git a/html.go b/html.go index 754213e..a60cdd6 100644 --- a/html.go +++ b/html.go @@ -1133,6 +1133,9 @@ func (r *HTML) RenderNode(w io.Writer, node *Node, entering bool) WalkStatus { r.out(w, tag("/del", nil, false)) } case HTMLSpan: + if r.flags&SkipHTML != 0 { + break + } if r.flags&SkipStyle != 0 && isHtmlTag(node.Literal, "style") { break } @@ -1237,6 +1240,9 @@ func (r *HTML) RenderNode(w io.Writer, node *Node, entering bool) WalkStatus { } break case HTMLBlock: + if r.flags&SkipHTML != 0 { + break + } r.cr(w) r.out(w, node.Literal) r.cr(w) diff --git a/inline_test.go b/inline_test.go index 0d10ff5..8a713a0 100644 --- a/inline_test.go +++ b/inline_test.go @@ -1158,3 +1158,13 @@ func TestUseXHTML(t *testing.T) { "
\n", }, TestParams{HTMLFlags: UseXHTML}) } + +func TestSkipHTML(t *testing.T) { + doTestsParam(t, []string{ + "
\n\ntext\n\n
the form
", + "

text

\n", + + "text inline html more text", + "

text inline html more text

\n", + }, TestParams{HTMLFlags: SkipHTML}) +}