We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56d9398 commit d366e14Copy full SHA for d366e14
2 files changed
lib/docs/core/parser.rb
@@ -11,7 +11,7 @@ def html
11
private
12
13
def document?
14
- @content =~ /\A\s*<!doctype/i
+ @content =~ /\A\s*<(?:\!doctype|html)/i
15
end
16
17
def parse_as_document
test/lib/docs/core/parser_test.rb
@@ -22,6 +22,9 @@ def parser(content)
22
it "returns the <body>" do
23
body = '<!doctype html><meta charset=utf-8><title></title><div>Test</div>'
24
assert_equal '<div>Test</div>', parser(body).html.inner_html
25
+
26
+ body = '<html><meta charset=utf-8><title></title><div>Test</div></html>'
27
+ assert_equal '<div>Test</div>', parser(body).html.inner_html
28
29
30
0 commit comments