Safari's DOM support in XHTML is horribly broken. Send it S5 slideshows as text/html. (Sorry: no inline SVG for you!)
Turn on Maruku's Math support in S5 slideshows, only if corresponding Web is Math-enabled.
This commit is contained in:
parent
0db06a9fa3
commit
19889c98d4
|
@ -149,7 +149,9 @@ class ApplicationController < ActionController::Base
|
||||||
@response.headers['Content-Type'] = 'text/xml; charset=UTF-8'
|
@response.headers['Content-Type'] = 'text/xml; charset=UTF-8'
|
||||||
elsif %w(tex).include?(action_name)
|
elsif %w(tex).include?(action_name)
|
||||||
@response.headers['Content-Type'] = 'text/plain; charset=UTF-8'
|
@response.headers['Content-Type'] = 'text/plain; charset=UTF-8'
|
||||||
elsif @request.env['HTTP_USER_AGENT'] =~ /MathPlayer|Validator/ or @request.env.include?('HTTP_ACCEPT') && Mime::Type.parse(@request.env["HTTP_ACCEPT"]).include?(Mime::XHTML)
|
elsif @request.env['HTTP_USER_AGENT'] =~ /MathPlayer|Validator/ or @request.env.include?('HTTP_ACCEPT') &&
|
||||||
|
Mime::Type.parse(@request.env["HTTP_ACCEPT"]).include?(Mime::XHTML) &&
|
||||||
|
!(@request.env['HTTP_USER_AGENT'] =~ /Safari/ and %w(s5).include?(action_name))
|
||||||
@response.headers['Content-Type'] = 'application/xhtml+xml; charset=UTF-8'
|
@response.headers['Content-Type'] = 'application/xhtml+xml; charset=UTF-8'
|
||||||
else
|
else
|
||||||
@response.headers['Content-Type'] = 'text/html; charset=UTF-8'
|
@response.headers['Content-Type'] = 'text/html; charset=UTF-8'
|
||||||
|
|
|
@ -293,10 +293,16 @@ class WikiController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def s5
|
def s5
|
||||||
if @web.markup == :markdownMML or @web.markup == :markdown
|
if @web.markup == :markdownMML
|
||||||
@s5_content = sanitize_html(Maruku.new(@page.content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F").to_ncr,
|
@s5_content = sanitize_html(Maruku.new(@page.content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"),
|
||||||
{:math_enabled => true, :math_numbered => ['\\[','\\begin{equation}'], :content_only => true,
|
{:math_enabled => true, :math_numbered => ['\\[','\\begin{equation}'], :content_only => true,
|
||||||
:author => @page.author, :title => @page.plain_name}).to_s5)
|
:author => @page.author, :title => @page.plain_name}).to_s5).to_ncr
|
||||||
|
elsif @web.markup == :markdown
|
||||||
|
@s5_content = sanitize_html(Maruku.new(@page.content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"),
|
||||||
|
{:math_enabled => false, :content_only => true,
|
||||||
|
:author => @page.author, :title => @page.plain_name}).to_s5).to_ncr
|
||||||
|
else
|
||||||
|
@s5_content = "S5 not supported with this text filter"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue