-
Notifications
You must be signed in to change notification settings - Fork 97
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax Highlighting doesn't work in preview #854
Comments
You need to enable syntax highlighting:
Having said that, the grey box on top of the code block is unexpected, I will take a look 馃憖 |
I do have it activated in the
and it also works in the PDF output. It just doesn't work in the preview of VS Code. If I'm setting this option:
Then I the black box is gone (maybe something with dark mode)? So, with the option Thanks for the fast reply! |
Rouge is written in Ruby and is not available in a JavaScript environment. Only Highlight.js is compatible with Asciidoctor.js. You can use a
In theory, we could check if |
Ah that fixed it. Thank you so much! 馃槉 |
I'm glad it's working. I'm reopening because I think we can improve things:
|
Not sure if this is related to this issue. But now my syntax highlighting works in my preview but not in my generated pdf anymore with It doesn't work with Setting in
Any clue on what I can do here? |
Asciidoctor PDF is written in Ruby and does not support Highlight.js. You can use Highlight.js when converting to HTML with Asciidoctor (Ruby) because the syntax highlighting is done client side. Asciidoctor (Ruby) also supports Rouge when converting to HTML. In this case, the syntax highlighting is done during the processing. As mentioned above, you should use: "asciidoc.preview.asciidoctorAttributes": {
"source-highlighter": "highlight.js"
} You can leave |
Okay that works thanks! |
Hi 馃憢馃徑
my syntax highlighting doesn't use my template in the VS Code Preview and looks a bit off:
![image](https://private-user-images.githubusercontent.com/19362086/312728429-d695da95-1774-4915-9d15-4f77c9ca49d1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5MzA5MTIsIm5iZiI6MTcxOTkzMDYxMiwicGF0aCI6Ii8xOTM2MjA4Ni8zMTI3Mjg0MjktZDY5NWRhOTUtMTc3NC00OTE1LTlkMTUtNGY3N2M5Y2E0OWQxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzAyVDE0MzAxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJhZGZiMGE3ZTM3ZDBjZGI3MGY5YmRjZmM5ZTgwMDA2NjJhYjJhODUxODEyZDE5MDM0MGY2NGVmMmVmYmJhZTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.k5erzerMzWFBqOWr8sOh2Nfo7PYT4GaXbHWPcj-D32s)
I'm opening the main entry file
main.adoc
in a locked preview.Once I'm exporting it it works properly.
Am I missing any setting or is this a current bug? 馃
System Info
Version: 1.87.2 (Universal)
Commit: 863d2581ecda6849923a2118d93a088b0745d9d6
Date: 2024-03-08T15:21:31.043Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0
Extension
asciidoctor.asciidoctor-vscode: v.3.2.0
Thanks! 馃槉
The text was updated successfully, but these errors were encountered: