Sanitize REML trees

OK. Enabled sanitization of rexml trees instead of strings.
My timing tests seem to be erratic. Can't tell whether this is really faster.
This commit is contained in:
Jacques Distler 2007-06-05 17:13:44 -05:00
parent bd8ba1f4b1
commit f0cf0ec625

View file

@ -42,7 +42,8 @@ module Engines
def mask def mask
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 = sanitize_rexml(Maruku.new(@content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"),
{:math_enabled => false}).to_html_tree)
sanitize_xhtml(html.to_ncr) sanitize_xhtml(html.to_ncr)
end end
end end
@ -53,10 +54,8 @@ module Engines
def mask def mask
require_dependency 'maruku' require_dependency 'maruku'
require_dependency 'maruku/ext/math' require_dependency 'maruku/ext/math'
# html = sanitize_rexml(Maruku.new(@content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"), html = sanitize_rexml(Maruku.new(@content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"),
# {:math_enabled => true, :math_numbered => ['\\[','\\begin{equation}']}).to_html_tree) {:math_enabled => true, :math_numbered => ['\\[','\\begin{equation}']}).to_html_tree)
html = sanitize_xhtml(Maruku.new(@content.delete("\r\x01-\x08\x0B\x0C\x0E-\x1F"),
{:math_enabled => true, :math_numbered => ['\\[','\\begin{equation}']}).to_html.to_ncr)
end end
end end