theme-particlex / hexo-theme-particlex

A concise Hexo theme, based on Particle.
MIT License
410 stars 56 forks source link

代码框与代码高亮失效 #65

Closed LynxCatTheThird closed 1 year ago

LynxCatTheThird commented 1 year ago

最近尝试着将更新至最新版,随后发现代码框不正常,代码高亮故障。


C++

Markdown源代码为

xxxxxxxxxxxx

``` cpp
#include<iostream>
using namespace std;
int main{
    int n;
    cin>>n;
    cout<<n;
    return 0;
}

xxxxxxxxxxxx


渲染后,语言标签与复制按钮消失(无相关元素),部分代码丢失,语言标签“Cpp”跑到了代码框内。效果为:

![image](https://user-images.githubusercontent.com/103188954/226081474-aa5bc73d-6f5c-4be8-885f-9fb6498ad583.png)

---

### HTML

Markdown源代码为

```` Markdown
如有可能,请将您的信息格式化为如下格式(尽可能保留各行前的 12 个空格):

``` HTML
         <div class="card">
            <img class="ava" src="头像" />
            <div class="card-header">
               <div>
                  <a href="链接">昵称</a>
               </div>
               <div class="info">签名</div>
            </div>
         </div>

同时奉上本站信息:



渲染后,大部分代码丢失,但复制按钮却仍然可以复制到全部代码。效果为:

![image](https://user-images.githubusercontent.com/103188954/226081995-4bb3e9cc-4f71-43dd-bb19-4740840f28c6.png)

---

### 一些可能有用的信息

1. 似乎不是渲染器的问题。我尝试将渲染器从 `[hexo-renderer-markdown-it](https://github.com/hexojs/hexo-renderer-markdown-it)` 换到 `[hexo-renderer-marked](https://github.com/hexojs/hexo-renderer-marked)`,并无作用
2. Hexo 自带的高亮已停用
3. `Highlight.js` 加载似乎无异常
4. Config 在 [https://github.com/LynxCatTheThird/web-new/](https://github.com/LynxCatTheThird/web-new/)
LynxCatTheThird commented 1 year ago

image

image

刚才看了看 hexo g 出来的 HTML,似乎并无异常。

argvchs commented 1 year ago

不要用 MarkdownIt 啊 MarkdownIt 无法渲染 LaTeX

argvchs commented 1 year ago

渲染后,语言标签与复制按钮消失(无相关元素),部分代码丢失,语言标签“Cpp”跑到了代码框内

但是。。

我这里新建了一个博客然后安装主题,渲染非常正常 应该是你更新不对

image

argvchs commented 1 year ago

最新版应该是 v2.5.5,你是不是用的 v2.5.4 有这个问题

https://github.com/argvchs/hexo-theme-particlex/blob/d8332bbd1dab8253317dde2cbfdc84985cf2c23e/package.json#L3

LynxCatTheThird commented 1 year ago

我想我可以尝试一下用未经修改的主题试试……