Commit 5a9410e0 authored by Francisco Juan's avatar Francisco Juan

fix syntax highlighting methods

parent a1a13c8e
......@@ -36,8 +36,8 @@ module Redmine
# Highlights +text+ as the content of +filename+
# Should not return line numbers nor outer pre tag
def highlight_by_filename(text, filename)
language = ::CodeRay::FileType[filename]
language ? ::CodeRay.scan(text, language).html : ERB::Util.h(text)
language = ::CodeRay::FileType.fetch filename, :text
::CodeRay.scan(text, language).html
end
# Highlights +text+ using +language+ syntax
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment