-
-
Save loganhasson/dcbc722e4121e7868756 to your computer and use it in GitHub Desktop.
Revisions
-
adamflorin created this gist
Oct 18, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ require 'redcarpet' # Custom handler that raises error. # module Redcarpet module Render class Crasher < HTML def paragraph(text) raise "Error!" end end end end redcarpet = Redcarpet::Markdown.new Redcarpet::Render::Crasher # Will loop a certain number of times (always 17 for me for some reason) # and then CRASH with: # # Assertion failed: (md->work_bufs[BUFFER_BLOCK].size == 0), function sd_markdown_render, file markdown.c, line 2544. # Abort trap: 6 # 20.times do begin redcarpet.render "Body text." rescue RuntimeError => e puts "Error: #{e.message}" end end