To be really XML-safe, don't emit XHTML+MathML named entities. (Ported MathML::Entities to Ruby.)
This commit is contained in:
parent
9b9d134ad9
commit
0db06a9fa3
|
@ -294,7 +294,7 @@ class WikiController < ApplicationController
|
||||||
|
|
||||||
def s5
|
def s5
|
||||||
if @web.markup == :markdownMML or @web.markup == :markdown
|
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,
|
{: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)
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,7 +43,7 @@ module Engines
|
||||||
require_dependency 'maruku'
|
require_dependency 'maruku'
|
||||||
require_dependency 'maruku/ext/math'
|
require_dependency 'maruku/ext/math'
|
||||||
html = Maruku.new(@content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"), {:math_enabled => false}).to_html
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ module Engines
|
||||||
require_dependency 'maruku/ext/math'
|
require_dependency 'maruku/ext/math'
|
||||||
html = Maruku.new(@content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"),
|
html = Maruku.new(@content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"),
|
||||||
{:math_enabled => true, :math_numbered => ['\\[','\\begin{equation}']}).to_html
|
{:math_enabled => true, :math_numbered => ['\\[','\\begin{equation}']}).to_html
|
||||||
sanitize_html(html)
|
sanitize_html(html).to_ncr
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
2139
lib/string_utils.rb
2139
lib/string_utils.rb
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue