Sync with latest Maruku.

This commit is contained in:
Jacques Distler 2007-03-01 22:46:49 -06:00
parent 6ee59e7e49
commit 5a352d0f5e

View file

@ -6,11 +6,12 @@ module MaRuKu
# Render as an HTML fragment (no head, just the content of BODY). (returns a string) # Render as an HTML fragment (no head, just the content of BODY). (returns a string)
def to_s5(context={}) def to_s5(context={})
indent = context[:indent] || -1 indent = context[:indent] || -1
ie_hack = context[:ie_hack] ||true ie_hack = !context[:ie_hack].kind_of?(FalseClass)
content_only = context[:content_only] ||true content_only = !context[:content_only].kind_of?(FalseClass)
doc = Document.new(nil,{:respect_whitespace =>:all}) doc = Document.new(nil,{:respect_whitespace =>:all})
if (content_only)
if content_only
body = Element.new('div', doc) body = Element.new('div', doc)
else else
html = Element.new('html', doc) html = Element.new('html', doc)
@ -22,14 +23,12 @@ module MaRuKu
me.attributes['http-equiv'] = 'Content-type' me.attributes['http-equiv'] = 'Content-type'
me.attributes['content'] = 'text/html;charset=utf-8' me.attributes['content'] = 'text/html;charset=utf-8'
# Create title element # Create title element
doc_title = self.attributes[:title] || self.attributes[:subject] || "" doc_title = self.attributes[:title] || self.attributes[:subject] || ""
title = Element.new 'title', head title = Element.new 'title', head
title << Text.new(doc_title) title << Text.new(doc_title)
body = Element.new('body', html) body = Element.new('body', html)
end end
slide_header = self.attributes[:slide_header] slide_header = self.attributes[:slide_header]
@ -83,7 +82,6 @@ module MaRuKu
h1 = Element.new 'h1', div h1 = Element.new 'h1', div
slide.header_element.children_to_html.each do |e| h1 << e; end slide.header_element.children_to_html.each do |e| h1 << e; end
array_to_html(slide.immediate_children).each do |e| div << e end array_to_html(slide.immediate_children).each do |e| div << e end
# render footnotes # render footnotes
@ -105,7 +103,7 @@ module MaRuKu
# REXML Bug? if indent!=-1 whitespace is not respected for 'pre' elements # REXML Bug? if indent!=-1 whitespace is not respected for 'pre' elements
# containing code. # containing code.
html.write(xml,indent,transitive=true,ie_hack); html.write(xml,indent,transitive=true,ie_hack);
Xhtml10strict + xml Xhtml11_mathml2_svg11 + xml
end end
end end