module MathML::Util

Constants

EQNARRAY_RE
ESCAPES
INVALID_RE
SINGLE_COMMAND_RE

Public Class Methods

collect_regexp(a) click to toggle source
   # File lib/math_ml/util.rb
31 def self.collect_regexp(a)
32         if a
33                 a = [a].flatten
34                 a.size>0 ? Regexp.new(a.inject(""){|r, i| i.is_a?(Regexp) ? "#{r}#{i.to_s}|" : r}.chop) : INVALID_RE
35         else
36                 INVALID_RE
37         end
38 end
escapeXML(s, br=false) click to toggle source
   # File lib/math_ml/util.rb
22 def self.escapeXML(s, br=false)
23         r = s.gsub(/[<>&"']/){|m| "&#{ESCAPES[m]};"}
24         br ? r.gsub(/\n/, "<br />\n") : r
25 end

Public Instance Methods

collect_regexp(a) click to toggle source
   # File lib/math_ml/util.rb
40 def collect_regexp(a)
41         MathML::Util.collect_regexp(a)
42 end
escapeXML(s, br=false) click to toggle source
   # File lib/math_ml/util.rb
27 def escapeXML(s, br=false)
28         MathML::Util.escapeXML(s, br)
29 end