You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've seen this fail both with a NoMethodError for match on nil (when the pygments method returns nil although it shouldn't) as well as with a NoMethodError for [] on nil when the match fails.
True, all of this was triggered by not using raw and endraw appropriately, but still I feel that the above code is unsatisfying and could handle the situation better. Throwing exceptions and leaving the user with no clue as to what happened is rather unacceptable IMHO...
I do have workaround code that at least renders an empty highlighting box into the page so the build doesn't fail and I know which snippet caused the problem, but I won't attach it here for now because (a) it's hacky and (b) I don't think it's really the best way to handle this.
I volunteer to implement a solution though once we have agreed here how and if this should be addressed.
The text was updated successfully, but these errors were encountered:
PuercoPop
pushed a commit
to PuercoPop/octorgopress
that referenced
this issue
Mar 16, 2014
I was running into this problem
imathis/octopress#1342 an awful lot, and it
was happening in really wonky scenarios that seemed to be dependent on
the number of code blocks in a file (?!!)
Using these other code block delimeters for blocks without a language
specified seems to skip the syntax highlighting code path
In line 14 of
plugins/pygments_code.rb
:I've seen this fail both with a
NoMethodError
formatch
onnil
(when thepygments
method returnsnil
although it shouldn't) as well as with aNoMethodError
for[]
onnil
when thematch
fails.True, all of this was triggered by not using
raw
andendraw
appropriately, but still I feel that the above code is unsatisfying and could handle the situation better. Throwing exceptions and leaving the user with no clue as to what happened is rather unacceptable IMHO...I do have workaround code that at least renders an empty highlighting box into the page so the build doesn't fail and I know which snippet caused the problem, but I won't attach it here for now because (a) it's hacky and (b) I don't think it's really the best way to handle this.
I volunteer to implement a solution though once we have agreed here how and if this should be addressed.
The text was updated successfully, but these errors were encountered: