Class: MarkupMask
- Inherits:
-
Object
- Object
- MarkupMask
- Defined in:
- lib/markup_mask.rb
Class Method Summary collapse
Class Method Details
.markup_mask(text) ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/markup_mask.rb', line 2 def self.markup_mask(text) = /(<\/?\w+(?:(?:\s+\w+(?:\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>)/ nbspsRegExp = /( )/ jsRegExp = /(function.*?})/ @regex = Regexp.union(nbspsRegExp, , jsRegExp) unless text.nil? @text_arr = text.split(@regex) end end |