New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use custom Rouge formatter for highlighting #617
Comments
It seems that the formatter subclasses don't share a common constructor interface. Some need the options, some another formatter, some yet another thing... Any suggestions? The only way to solve this seems to be to specify the formatter as class and not as string. |
I did take this issue up to Rouge's maintainers themselves, but there hasn't been a response till date.
I would recommend to implement an adapter of sorts. But not sure, if that lies within the scope of |
The problem with the adapter route is that if a formatter takes another formatter, which one should it take? |
The basic idea is to emulate the implementation for |
I just ran into this issue trying to use
This seems to suggest it should already be possible, or am I misunderstanding the comment? |
@daenney I really can't remember why I wrote what you quoted but since the formatter class is first resolved, regardless of whether it is specified as class or string, and only then an object instantiated, it won't be possible in this way. Writing an adapter would work but I don't want to complicate things on kramdown's end when rouge can do that better. So as @ashmaroli said: We are leaving this as it is for now and see what rouge does. |
@ashmaroli @daenney I don't think that rouge will do something about this. So on kramdown's end I will document the requirements for the formatter option of rouge and the user will need to make sure that s/he provides a correct (wrapper) class. |
Given that I have the following configuration:
However when I try to convert a code-block, I get the following error:
On bisecting, the issue occurs due to the following:
kramdown/lib/kramdown/converter/syntax_highlighter/rouge.rb
Line 33 in 2ff9d43
The reason being that
Rouge::Formatters::HTMLTable
should be constructed by passing another "formatter" instance:The text was updated successfully, but these errors were encountered: