Skip to content

Highlight Lines in Source disables syntax colouring #525

@abul4fia

Description

@abul4fia

I don't know if I'm doing something wrong. My setup is:

:source-highlighter: highlightjs
:revealjsdir: https://cdn.jsdelivr.net/npm/reveal.js@4.4.0
:revealjs_theme: white

If I wrote code such as:

=== Example

[source,c]
----
#include <stdio.h>

int main() {
    printf("Hello\n");
    return 0;
}
----

then all works as expected, and I get coloured syntax in the slide:

image

But if I try to highlight one line:

=== Example

[source,c, highlight=4]
----
#include <stdio.h>

int main() {
    printf("Hello\n");
    return 0;
}
----

Then two unexpected things happen:

  1. Lines are suddenly numbered
  2. Syntax colouring disappears. Everything is gray
image

I'm using

Asciidoctor reveal.js 5.1.0 using Asciidoctor 2.0.18 [https://asciidoctor.org]
Runtime Environment (ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

I'm I doing something wrong? Is this a known issue? I was unable to find anything...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions