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

Public Instance Methods

collect_regexp(a) click to toggle source
   # File lib/math_ml/util.rb
43 def collect_regexp(a)
44   MathML::Util.collect_regexp(a)
45 end
escapeXML(s, br = false) click to toggle source
   # File lib/math_ml/util.rb
26 def escapeXML(s, br = false)
27   MathML::Util.escapeXML(s, br)
28 end