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

Emmet does not use correct syntax highlighting #15

Open
mak0226 opened this issue Aug 30, 2022 · 5 comments
Open

Emmet does not use correct syntax highlighting #15

mak0226 opened this issue Aug 30, 2022 · 5 comments

Comments

@mak0226
Copy link

mak0226 commented Aug 30, 2022

I'm currently using @codemirror/theme-one-dark on Codemirror 6 alongside Emmet (implemented using the abbreviationTracker extension) and I've noticed that the syntax highlighting is incorrect. See below for images.

How it should look:
Screenshot 2022-08-30 7 15 00 PM

How it looks:
Screenshot 2022-08-30 7 14 36 PM

Thanks.

@sergeche
Copy link
Member

You should pass syntax highlighting as option: abbreviation({ preview: { html: yourCustomHighighter } })

@shshaw
Copy link
Contributor

shshaw commented Mar 8, 2023

Do you have an example of how exactly that should be used?

abbreviationTracker({
  preview: {
     html: // theme or language?
  }
});

@sergeche
Copy link
Member

sergeche commented Mar 9, 2023

You should pass an extension factory function, which will be invoked when preview widget is created. E.g.

import { html } from '@codemirror/lang-html';
abbreviationTracker({
  preview: {
     html: html
  }
});

@shshaw
Copy link
Contributor

shshaw commented Mar 9, 2023

Hm. But is that the way to actually load a theme? That would just be for the language syntax

@sergeche
Copy link
Member

AFAIK there’s no such thing as theme or language syntax, only extensions. From factory function, you may return an extension or array of extensions, I think you may just define which extensions (syntax highlight, theme etc) you want to use in preview.

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

3 participants