Skip to content

Unable to use custom Rouge formatter for highlighting #617

Closed
@ashmaroli

Description

@ashmaroli

Given that I have the following configuration:

syntax_highlighter_opts:
  formatter: HTMLTable

However when I try to convert a code-block, I get the following error:

private method `format' called for #<Hash:0x000000000601f440>

On bisecting, the issue occurs due to the following:

formatter = formatter_class(opts).new(opts)

The reason being that Rouge::Formatters::HTMLTable should be constructed by passing another "formatter" instance:

Rouge::Formatters::HTMLTable.new(Rouge::Formatters::HTML.new, opts)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions