Skip to content

Implement support for rouge-linenums-mode (add inline mode) #3641

@hepabolu

Description

@hepabolu

I'm using asciidoctor 2.0.10 to generate HTML. I use Rouge for syntax highlighting.

According to https://asciidoctor.org/docs/user-manual/#rouge I should use

:rouge-linenums-mode: inline

for sourceblocks that have long lines. However, that option doesn't seem to work. It doesn't make any difference if I use 'table' or 'inline'.

In both cases the codeblock renders as a table with 2 cells, one containing a '

' tag with all the line numbers, one with the lines as spans wrapped in 1 '
' tag.

On a large block of long lines the linenumbers end way earlier than the actual lines.

This code: https://rouge-ruby.github.io/docs/Rouge/Formatters/HTMLLineTable.html suggests there should be a row with a linenumber + source code line per line.

But that class is never used in https://github.com/asciidoctor/asciidoctor/blob/master/lib/asciidoctor/syntax_highlighter/rouge.rb

I'm not good in Ruby, so I might be overlooking something. If so, please let me know.

Metadata

Metadata

Assignees

Labels

enhancementIssues that introduce a new capability or functionalityv2.1.0Issues resolved in the 2.1.0 release.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions