Permalink
Browse files

[fix] html5: changed html5 resource page header a bit

  • Loading branch information...
1 parent 06d60a8 commit 3c185de092c49dd3e2ec82b29d855d09546b7100 @Aqua-Ye Aqua-Ye committed Dec 17, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 stdlib/core/web/resource/resource_private.opa
@@ -538,7 +538,7 @@ shared_xhtml1_1_header =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"
shared_html5_header =
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE html>"
+ "<!DOCTYPE html>"
shared_xml_header =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
@@ -928,10 +928,12 @@ export_resource(external_css_files: list(string),
<></>, base_url)
ready_head = <head>{base}{head_without_id}{global_variable}</head>
- doctype = match doctype with {some=d} -> html_doctype_to_string(d) {none} -> shared_xhtml1_1_header
+ html_doctype = match doctype with {some=d} -> html_doctype_to_string(d) {none} -> shared_xhtml1_1_header
- page= Xhtml.of_string_unsafe(doctype) <+>
- <html xmlns="http://www.w3.org/1999/xhtml">{ready_head}{ready_body}</html>
+ page = Xhtml.of_string_unsafe(html_doctype) <+>
+ (match doctype
+ {some={html5}} -> <html>{ready_head}{ready_body}</html>
+ _ -> <html xmlns="http://www.w3.org/1999/xhtml">{ready_head}{ready_body}</html>)
//Serialize and send
data = Xhtml.serialize_to_string(page)

0 comments on commit 3c185de

Please sign in to comment.