markup icon indicating copy to clipboard operation
markup copied to clipboard

Add support for kramdown options

Open dometto opened this issue 3 years ago • 2 comments

For commonmarker, it is already possible to pass in parsing and rendering options in the GitHub::Markup.render call, e.g.:

GitHub::Markup.render("test.md", "hello <bad> world", options: {commonmarker_opts: [:UNSAFE]})

This PR adds support for the same feature for the kramdown implementation, allowing e.g.:

GitHub::Markup.render("# Test\n", options: {:kramdown_opts => { :auto_ids=>false}})

I've also added tests, which necessitated requiring kramdown on both the JRuby and MRI platforms (instead of just JRuby). If this is undesirable, the tests could also be left out by reverting the last commit from this PR.

dometto avatar May 16 '22 11:05 dometto

@aharpole any chance this could be merged?

dometto avatar Aug 11 '22 16:08 dometto

The test failure is unrelated. The cgi gem is apparently calling String#delete_prefix, which doesn't exist on ruby 2.4.1. May be related to 2.4's general oldness and this warning: Your RubyGems version (2.6.14.4) has a bug that prevents "required_ruby_version" from working for Bundler.

dometto avatar Aug 14 '22 16:08 dometto