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

Aplayer conflicts with hexo-toc #242

Open
huweihuang opened this issue Oct 13, 2018 · 5 comments
Open

Aplayer conflicts with hexo-toc #242

huweihuang opened this issue Oct 13, 2018 · 5 comments

Comments

@huweihuang
Copy link

huweihuang commented Oct 13, 2018

I use MetingJs for my website, and MetingJs use Aplayer.
The problem is the Chinese title field of my article cannot be linked properly,which is generated by hexo-toc.
If I disable the use of Aplayer(MetingJS), this problem is solved.So I guess that aplayer conflicts with hexo-toc, causing Chinese to fail to parse normally.But I don't know how to solve this problem. Can someone help me?

my website code reference:https://github.com/huweihuang/www.huweihuang.com/blob/master/themes/huweihuang/layout/post.ejs#L38

Article link:https://www.huweihuang.com/article/kubernetes/kubernetes-resource/
(The English title of the article can be parsed normally, but the Chinese title cannot be parsed normally.)

MetingJS issue:metowolf/MetingJS#5

@scillidan
Copy link

scillidan commented Feb 13, 2019

mark一个。同样的问题

@ihuanrong
Copy link

我也遇到了相同的问题,希望作者能够解决。

@ZeppLu
Copy link

ZeppLu commented Mar 23, 2020

这个问题是aplayer依赖的webpack引入的smoothscroll.js导致的,它给hashtag链接的click事件增加了listener,但是却不能正确处理含有中文的hashtag链接(因为url编码)。这玩意儿17年到现在都没更新过,也难怪。

解决方法是将含有hashtag链接的node复制一份替换掉原来的,这样就能移除掉所有的event listener,详见https://stackoverflow.com/a/9251864

不过有一说一,一个音乐播放器,为什么要依赖另一个功能完全无关(用于平滑滚动页面)的脚本呢?

@tianheg
Copy link

tianheg commented May 19, 2020

@huweihuang I just checked it on your blog and found that your conflict has been resolved. I also encountered this problem, so I put the following code originally in head.html directly into the about.md, and it works !

<!-- require APlayer -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
<!-- require MetingJS -->
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>

And I see your "about"'s source code, we do the same. 😂

@stevenjoezhang
Copy link

It's still not fixed: hexojs/hexo#4488

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

6 participants