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
  • 150,910
  • 39
  • 198
  • 279
Juuro
  • 1,167
  • 4
  • 11
  • 22

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
  • 48,038
  • 8
  • 56
  • 100
  • 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
  • 25,901
  • 2
  • 72
  • 86