Version 0.16.1
Make this version (minimally) usable with Textile Markup: For Webs with "Textile", "RDoc" or "Mixed" markup option selected, send text/html instead of application/xhtml+xml. This makes this software minimally usable with those markup dialects. "Markdown+itex2MML", "Markdown+BlahTeX/PNG" and "Markdown" should work as before, sending application/xhtml+xml to capable browsers. Bump the version number.
This commit is contained in:
parent
bdcb506418
commit
8832dd3438
|
@ -156,13 +156,17 @@ class ApplicationController < ActionController::Base
|
||||||
response.content_type = Mime::ATOM
|
response.content_type = Mime::ATOM
|
||||||
elsif %w(tex).include?(action_name)
|
elsif %w(tex).include?(action_name)
|
||||||
response.content_type = Mime::TEXT
|
response.content_type = Mime::TEXT
|
||||||
elsif request.user_agent =~ /Validator/ or request.env.include?('HTTP_ACCEPT') &&
|
elsif xhtml_enabled?
|
||||||
|
if request.user_agent =~ /Validator/ or request.env.include?('HTTP_ACCEPT') &&
|
||||||
Mime::Type.parse(request.env["HTTP_ACCEPT"]).include?(Mime::XHTML)
|
Mime::Type.parse(request.env["HTTP_ACCEPT"]).include?(Mime::XHTML)
|
||||||
response.content_type = Mime::XHTML
|
response.content_type = Mime::XHTML
|
||||||
elsif request.user_agent =~ /MathPlayer/
|
elsif request.user_agent =~ /MathPlayer/
|
||||||
response.charset = nil
|
response.charset = nil
|
||||||
response.content_type = Mime::XHTML
|
response.content_type = Mime::XHTML
|
||||||
response.extend(MathPlayerHack)
|
response.extend(MathPlayerHack)
|
||||||
|
else
|
||||||
|
response.content_type = Mime::HTML
|
||||||
|
end
|
||||||
else
|
else
|
||||||
response.content_type = Mime::HTML
|
response.content_type = Mime::HTML
|
||||||
end
|
end
|
||||||
|
@ -196,6 +200,10 @@ class ApplicationController < ActionController::Base
|
||||||
not @web_name.nil?
|
not @web_name.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def xhtml_enabled?
|
||||||
|
in_a_web? and (@web.markup == :markdownMML or @web.markup == :markdownPNG or @web.markup == :markdown)
|
||||||
|
end
|
||||||
|
|
||||||
def authorization_needed?
|
def authorization_needed?
|
||||||
not %w( login authenticate feeds published atom_with_headlines atom_with_content).include?(action_name)
|
not %w( login authenticate feeds published atom_with_headlines atom_with_content).include?(action_name)
|
||||||
end
|
end
|
||||||
|
@ -233,7 +241,7 @@ module Instiki
|
||||||
module VERSION #:nodoc:
|
module VERSION #:nodoc:
|
||||||
MAJOR = 0
|
MAJOR = 0
|
||||||
MINOR = 16
|
MINOR = 16
|
||||||
TINY = 0
|
TINY = 1
|
||||||
SUFFIX = '(MML+)'
|
SUFFIX = '(MML+)'
|
||||||
PRERELEASE = 'pre' # false
|
PRERELEASE = 'pre' # false
|
||||||
if PRERELEASE
|
if PRERELEASE
|
||||||
|
|
Loading…
Reference in a new issue