asciidoctor / atom-asciidoc-preview

⚛ AsciiDoc preview for the Atom editor.
https://atom.io/packages/asciidoc-preview
MIT License
142 stars 42 forks source link

Atom live preview syntax highlighting doesn't work after update to 2.12.3 #291

Open Foadsf opened 5 years ago

Foadsf commented 5 years ago

Description

follow up on this comment, Atom's live preview syntax highlighting used to work properly:

q1i1ovDb6w

But now after update it doesn't:

atom_2019-03-18_12-01-09

Screenshots

Your screenshot.

Syntax example

[source,scilab]
....
function y = fibonacci(N)
    select N
    case 0 then
        y = 0;
    case 1 then
        y = 1;
    else
        y0 = 0;
        y1 = 1;
        y = 1;
        for ii = 3:N do
            y0 = y1;
            y1 = y
            y = y1 + y0;
        end
    end
endfunction
....
ldez commented 5 years ago

Are you speaking about syntax highlighting inside the preview or inside the asciidoc document?

Foadsf commented 5 years ago

@ldez inside the live preview

ggrossetie commented 5 years ago

That's weird, did you enable syntax highlighting ? You might need to add :source-highlighter: highlight.js.

ggrossetie commented 5 years ago

2.12.3 is using Asciidoctor.js 1.5.9 ?

Foadsf commented 5 years ago

@Mogztter yes it is right on top of my code:

atom_2019-03-18_12-58-28

two days ago it was working even without this line as I reported.

2.12.3 is using Asciidoctor.js 1.5.9 ?

This I didn't know how to find. Would you be kind to instruct me how the Asciidoctor.js version should be found?

P.S. FireFox addon doesn't need this line either.

ggrossetie commented 5 years ago

@Foadsf you can use the built-in attribute asciidoctor-version. In your document add {asciidoctor-version} it will print the version.

Foadsf commented 5 years ago

@Mogztter thanks a lot {asciidoctor-version} --> 1.5.8

ggrossetie commented 5 years ago

Syntax highlighting is working for "common" languages:

ok

Not sure how the Scilab language was highlighted before... Scilab is not even in this list: https://github.com/asciidoctor/atom-asciidoc-preview/blob/8d4a41d1e14d8f7fffa507a3cf6973923248f942/lib/highlights-helper.coffee#L1

@ldez Any idea ?

Foadsf commented 5 years ago

@Mogztter now this is strange :) I'm happy I have screenshots otherwise I would doubt my sanity :))

ggrossetie commented 5 years ago

I get the same result with 2.12.2:

2122