Add colorize_without_wrapper

This commit is contained in:
Joshua Peek
2011-05-20 14:11:15 -05:00
parent bebae09fde
commit a94e06ac4d
6 changed files with 49 additions and 1 deletions

View File

@@ -23,7 +23,15 @@ module Linguist
end
def colorize(text)
Albino.colorize(text, to_s)
Albino.colorize(text, self)
end
def colorize_without_wrapper(text)
if text = colorize(text)
text[%r{<div class="highlight"><pre>(.*?)</pre>\s*</div>}m, 1]
else
''
end
end
def ==(other)