Skip to content
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

Custom highlight.js display errors #491

Open
n-bes opened this issue Jan 12, 2023 · 3 comments
Open

Custom highlight.js display errors #491

n-bes opened this issue Jan 12, 2023 · 3 comments

Comments

@n-bes
Copy link

n-bes commented Jan 12, 2023

Hi.
I have problem with local copy of reveal.js and highlight.js

Steps

  1. Download highlight.js from https://highlightjs.org/download/ folder and unpack archive to folder

    Highlight.js v11.7.0 (git: 82688fad18)

  2. Download reveal.js from GitHub:

    git clone -b 3.9.2 --depth 1 https://github.com/hakimel/reveal.js.git

  3. asciidoctor-revealjs version:

    ╰─➤  asciidoctor-revealjs-macos --version
    
    Asciidoctor reveal.js 4.1.0 using Asciidoctor.js 2.2.1 (Asciidoctor 2.0.12) [https://asciidoctor.org]
    Runtime Environment (node v12.13.1 on darwin)
    CLI version 3.2.0
    
  4. Build demo:

    asciidoctor-revealjs-macos demo.adoc

  5. Show directory data:

    ╰─➤  tree -L 1 .
    .
    ├── demo.adoc
    ├── demo.html
    ├── highlight
    └── reveal.js
    

Code

Comment highlightjsdit, highlightjs-theme to use bundled version.

= Hello
:revealjsdir: reveal.js
:revealjs_theme: white
:revealjs_controls: false
:highlightjsdir: highlight
:highlightjs-theme: highlight/styles/stackoverflow-dark.min.css
:source-highlighter: highlightjs

== Test
[source,java]
----
public class TestClass {
    public TestClass() {

    }

    public void testMethod() {

    }
}
----

[source,java,linenums,highlight=2..3]
----
public class TestClass {
    public TestClass() {

    }

    public void testMethod() {

    }
}
----

Results

Снимок экрана 2023-01-12 в 13 22 04
Снимок экрана 2023-01-12 в 13 22 46

@ggrossetie
Copy link
Member

As far as I remember reveal.js 3.9.2 is not compatible with Highlight.js >= 10. You should use highlight.js 9.18.0.

@n-bes
Copy link
Author

n-bes commented Jan 12, 2023

@Mogztter I found this part:

# REMIND: we cannot use Highlight.js 11+ because unescaped HTML support has been removed:

Originally, i tried to change theme, but without success

@ggrossetie
Copy link
Member

this commit is only available on 5.0.0-rc.1 (based on reveal.js 4):
https://github.com/asciidoctor/asciidoctor-reveal.js/releases/tag/v5.0.0-rc.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants