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

代码块主题预览失效 #1722

Closed
raisetwist opened this issue Nov 30, 2024 · 5 comments
Closed

代码块主题预览失效 #1722

raisetwist opened this issue Nov 30, 2024 · 5 comments
Assignees
Milestone

Comments

@raisetwist
Copy link

  1. Vditor有一个预览各种代码主题的按钮,现在那个里面调用的url好像是旧版的格式(没有min),导致多数主题出现网络错误,希望修复成正确的地址
  2. 设置defaultLang之后,在指定语言的代码块也会当成defaultLang高亮,是不是||两边的顺序反了
    谢谢!
@Vanessa219
Copy link
Owner

按照以下进行设置后,defaultLang 这个重现不了,你的参数和具体表现是?

 preview: {
            markdown: {
                toc: true,
                mark: true,
                footnotes: true,
                autoSpace: true,
            },
            math: {
                engine: 'KaTeX',
                inlineDigit: true,
            },
            hljs: {
                defaultLang:"js"
            }
        },

@Vanessa219 Vanessa219 changed the title 代码主题预览使用带min的css地址,并修复defaultLang行为 代码块主题预览失效 Dec 3, 2024
@Vanessa219 Vanessa219 self-assigned this Dec 3, 2024
@Vanessa219 Vanessa219 added this to the 3.10 milestone Dec 3, 2024
Vanessa219 added a commit that referenced this issue Dec 3, 2024
Vanessa219 added a commit that referenced this issue Dec 3, 2024
@raisetwist
Copy link
Author

raisetwist commented Dec 3, 2024

就这个参数也会有问题,可以试一下开一个语言为python的代码块,然后比较一下两种语言的注释如:

```python
# let this be a python comment
// this is a javascript comment
```

我这里第二行会是注释的颜色,第一行不是,let this还会被高亮

应该是highlightRender.ts的48行导致的,只要有defaultLang就会无视代码块的语言

@Vanessa219
Copy link
Owner

是这样么?

Jietu20241203-185626-HD.mp4

@raisetwist
Copy link
Author

raisetwist commented Dec 3, 2024

奇怪,我这边(3.10.7)会两个block都当成默认的js,你那好像两个都当成了python……

screen.mp4

而且这里的第48行看起来就是会出这个bug,只要设置了defaultLang就会每次都用

shot

@Vanessa219
Copy link
Owner

Vanessa219 commented Dec 3, 2024

抱歉,看明白了,下个版本修复。 #1728

Vanessa219 added a commit that referenced this issue Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants