To be really XML-safe, don't emit XHTML+MathML named entities. (Ported MathML::Entities to Ruby.)

This commit is contained in:
Jacques Distler 2007-03-29 03:30:10 -05:00
parent 9b9d134ad9
commit 0db06a9fa3
3 changed files with 2142 additions and 3 deletions

View file

@ -294,7 +294,7 @@ class WikiController < ApplicationController
def s5
if @web.markup == :markdownMML or @web.markup == :markdown
@s5_content = sanitize_html(Maruku.new(@page.content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"),
@s5_content = sanitize_html(Maruku.new(@page.content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F").to_ncr,
{:math_enabled => true, :math_numbered => ['\\[','\\begin{equation}'], :content_only => true,
:author => @page.author, :title => @page.plain_name}).to_s5)
end

View file

@ -43,7 +43,7 @@ module Engines
require_dependency 'maruku'
require_dependency 'maruku/ext/math'
html = Maruku.new(@content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"), {:math_enabled => false}).to_html
sanitize_html(html)
sanitize_html(html).to_ncr
end
end
@ -55,7 +55,7 @@ module Engines
require_dependency 'maruku/ext/math'
html = Maruku.new(@content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"),
{:math_enabled => true, :math_numbered => ['\\[','\\begin{equation}']}).to_html
sanitize_html(html)
sanitize_html(html).to_ncr
end
end

File diff suppressed because it is too large Load diff