Created
August 14, 2013 03:36
-
-
Save muojp/6227796 to your computer and use it in GitHub Desktop.
https://github.com/kmuto/review/pull/181 これを1.8.xと1.9.xで共に問題なく実行できそうなパッチ(VMの気持ちで考えたけど1.9.x試してない)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git diff -p | |
diff --git a/lib/review/htmlutils.rb b/lib/review/htmlutils.rb | |
index 64ef016..514ff53 100644 | |
--- a/lib/review/htmlutils.rb | |
+++ b/lib/review/htmlutils.rb | |
@@ -39,15 +39,19 @@ module ReVIEW | |
begin | |
require 'pygments' | |
- Pygments.highlight( | |
- unescape_html(body), | |
- :options => { | |
- :nowrap => true, | |
- :noclasses => true | |
- }, | |
- :formatter => format, | |
- :lexer => lexer) | |
- rescue LoadError, MentosError | |
+ begin | |
+ Pygments.highlight( | |
+ unescape_html(body), | |
+ :options => { | |
+ :nowrap => true, | |
+ :noclasses => true | |
+ }, | |
+ :formatter => format, | |
+ :lexer => lexer) | |
+ rescue MentosError | |
+ body | |
+ end | |
+ rescue LoadError | |
body | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment