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, line 31 def self.collect_regexp(a) if a a = [a].flatten a.size>0 ? Regexp.new(a.inject(""){|r, i| i.is_a?(Regexp) ? "#{r}#{i.to_s}|" : r}.chop) : INVALID_RE else INVALID_RE end end
escapeXML(s, br=false)
click to toggle source
# File lib/math_ml/util.rb, line 22 def self.escapeXML(s, br=false) r = s.gsub(/[<>&"']/){|m| "&#{ESCAPES[m]};"} br ? r.gsub(/\n/, "<br />\n") : r end
Public Instance Methods
collect_regexp(a)
click to toggle source
# File lib/math_ml/util.rb, line 40 def collect_regexp(a) MathML::Util.collect_regexp(a) end
escapeXML(s, br=false)
click to toggle source
# File lib/math_ml/util.rb, line 27 def escapeXML(s, br=false) MathML::Util.escapeXML(s, br) end