Page header now uses h1-title logic.

This commit is contained in:
Dawa Ometto
2014-11-04 23:23:46 +01:00
parent 442120bfdb
commit 7250962ba3
+6 -4
View File
@@ -14,7 +14,7 @@ module Precious
end
def page_header
page_header_from_content(@content) || title
title
end
def content
@@ -162,9 +162,11 @@ module Precious
# Returns page content without title if it was extracted.
#
def content_without_page_header(content)
doc = build_document(content)
title = find_header_node(doc)
title.remove unless title.empty?
doc = build_document(content)
if @h1_title
title = find_header_node(doc)
title.remove unless title.empty?
end
# .inner_html will cause href escaping on UTF-8
doc.css("div#gollum-root").children.to_xml(@@to_xml)
end