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

对于PJAX支持不完善的问题 #24

Closed
HenryZeng-Zero opened this issue Feb 2, 2024 · 3 comments
Closed

对于PJAX支持不完善的问题 #24

HenryZeng-Zero opened this issue Feb 2, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@HenryZeng-Zero
Copy link

问题描述:

情况1

图片

在目前的设置下,通过Hao主页进入文章

图片
图片

因为使用了pjax,所以并没有触发渲染。

情况2

即使从主页先进入Halo原生编辑器编写的页面
如:https://developer-zeng.com/archives/1704211071862
图片
然后通过侧栏切入:https://developer-zeng.com/archives/1706092867029
图片
依然没有进行渲染
图片

疑惑:

  • <仅在Markdown模式下渲染> 是如何控制渲染时机的?
  • 关闭 <仅在Markdown模式下渲染> 后,理应在正常 Halo原生编辑器编写的页面 就加载渲染代码,但是似乎没有加载?
@justice2001
Copy link
Owner

关于您提出的疑惑:

  1. Halo内部对文章有一个标记属性,来标记改文章使用的是什么语言类型。我是通过识别这个字段来实现的尽在Markdown下渲染的。
  2. 正常来讲确实应该是会加载,即使执行错误,也应当能够在页面中找到这个script元素。

@justice2001 justice2001 added the bug Something isn't working label Feb 2, 2024
@justice2001 justice2001 changed the title 在 Hao 主题下渲染代码注入时机不恰当 对于PJAX支持不完善的问题 Feb 2, 2024
@justice2001
Copy link
Owner

justice2001 commented Feb 2, 2024

已经找到问题所在了,核心问题是PJAX跳转时会重新加载渲染脚本,但是新加载的渲染脚本会产生冲突,所以出现了这个问题。

这个问题会在下个版本修复。

======= 补充 ==========

详细去了解了下,PJAX好像在跳转的时候会忽略文章中的script,这应该就是问题,修起来好像挺麻烦的还 。

@HenryZeng-Zero
Copy link
Author

HenryZeng-Zero commented Feb 21, 2024

非常感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants