mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add colorize_without_wrapper
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user