Skip to content

Instantly share code, notes, and snippets.

@muojp
Created August 14, 2013 03:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muojp/6227796 to your computer and use it in GitHub Desktop.
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試してない)
$ 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