should handle nil return value from pygments #128

Open
garfieldnate opened this Issue Jul 20, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@garfieldnate

My computer is apaprently super slow, so I have to set an environment variable MENTOS_TIMEOUT to get any output from Pygments at all. If the process takes too long then Pygments times out and returns nil. The pygments_code.rb plugin does not currently handle the nil return case. In Jekyll they print a nice notice: https://github.com/jekyll/jekyll/blob/407fc82b2d822ace149dfaf6ee74991163a9e2b6/lib/jekyll/tags/highlight.rb#L77. Also, once I set my timeout to be higher the plugin was still just grabbing the nil values out of the pygment cache; I had to set the timeout and delete the cache to get output.

So the nil value needs to be handled and the user notifed, and nil should not be stored into the cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment