1

I use Maruku in Rails simply to convert a Markdown file to HTML so I can use it with Nokogiri. (Maybe there's a better solution for that?) That works fine, but I get lots and lots of "Maruku tells you" messages in the log:

 ___________________________________________________________________________
| Maruku tells you:
+---------------------------------------------------------------------------
| Could not find ref_id = "FIX" for md_link("FIX", nil)
| Available refs are []
+---------------------------------------------------------------------------

That's really confusing and not needed here. Is there a way to silence Maruku so it only warns in the log if there's a real error?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Juuro
  • 1,487
  • 5
  • 16
  • 27

2 Answers2

2

Looking at the source code and documentation, it looks like you can set :on_error to :ignore :

Maruku.new(string, :on_error => :ignore)

It might also silence "real errors", though.

Eric Duminil
  • 52,989
  • 9
  • 71
  • 124
  • Thank you! This solution feels bad, but I didn't find anything better with Maruku. Seems it's time to use something a bit newer. – Juuro Jan 04 '17 at 09:27
1

Maybe try rdiscount gem?

I find Maruku too verbose with errors and do not want to have to ignore all error.

akuhn
  • 27,477
  • 2
  • 76
  • 91