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

Closed
opened 2024-02-02 17:49:57 +08:00 by Bot · 4 comments
Collaborator

Opened in GitHub by userHenryZeng-Zero

问题描述:

情况1

图片

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

图片
图片

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

情况2

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

疑惑:

  • <仅在Markdown模式下渲染> 是如何控制渲染时机的?
  • 关闭 <仅在Markdown模式下渲染> 后,理应在正常 Halo原生编辑器编写的页面 就加载渲染代码,但是似乎没有加载?
Opened in [GitHub](https://github.com/justice2001/halo-plugin-vditor/issues/24) by user[HenryZeng-Zero](https://github.com/HenryZeng-Zero) 问题描述: ## 情况1 ![图片](https://github.com/justice2001/halo-plugin-vditor/assets/36284614/9d1eb025-d524-4095-b00b-c73ad4252a59) 在目前的设置下,通过Hao主页进入文章 ![图片](https://github.com/justice2001/halo-plugin-vditor/assets/36284614/9f8f442a-28de-4ea9-a4c8-2d4939698512) ![图片](https://github.com/justice2001/halo-plugin-vditor/assets/36284614/d05f7d66-2a91-430c-963b-63c5781b3ea2) 因为使用了pjax,所以并没有触发渲染。 ## 情况2 即使从主页先进入Halo原生编辑器编写的页面 如:https://developer-zeng.com/archives/1704211071862 ![图片](https://github.com/justice2001/halo-plugin-vditor/assets/36284614/eab4bfb1-aba9-449a-8011-7c1ff16923dd) 然后通过侧栏切入:https://developer-zeng.com/archives/1706092867029 ![图片](https://github.com/justice2001/halo-plugin-vditor/assets/36284614/4c6e7b52-e3ab-4957-8cbb-c55c20918fb3) 依然没有进行渲染 ![图片](https://github.com/justice2001/halo-plugin-vditor/assets/36284614/35fc5be3-e58b-4298-9feb-95414c58de1b) 疑惑: + <仅在Markdown模式下渲染> 是如何控制渲染时机的? + 关闭 <仅在Markdown模式下渲染> 后,理应在正常 Halo原生编辑器编写的页面 就加载渲染代码,但是似乎没有加载?
Author
Collaborator

comment in GitHub by user avatarjustice2001

关于您提出的疑惑:

  1. Halo内部对文章有一个标记属性,来标记改文章使用的是什么语言类型。我是通过识别这个字段来实现的尽在Markdown下渲染的。
  2. 正常来讲确实应该是会加载,即使执行错误,也应当能够在页面中找到这个script元素。
comment in [GitHub](https://github.com/justice2001/halo-plugin-vditor/issues/24#issuecomment-1923719020) by user <img style="border-radius: 50%" src="https://avatars.githubusercontent.com/u/28425753?v=4" width="20" height="20" alt="avatar">[justice2001](https://github.com/justice2001) 关于您提出的疑惑: 1. Halo内部对文章有一个标记属性,来标记改文章使用的是什么语言类型。我是通过识别这个字段来实现的尽在Markdown下渲染的。 2. 正常来讲确实应该是会加载,即使执行错误,也应当能够在页面中找到这个script元素。
zhengyi added the
Kind
Bug
Status
Need More Info
Area
Render
labels 2024-02-02 20:48:09 +08:00
zhengyi added this to the v1.6.x milestone 2024-02-02 20:48:12 +08:00
Author
Collaborator

comment in GitHub by user avatarjustice2001

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

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

comment in [GitHub](https://github.com/justice2001/halo-plugin-vditor/issues/24#issuecomment-1924064736) by user <img style="border-radius: 50%" src="https://avatars.githubusercontent.com/u/28425753?v=4" width="20" height="20" alt="avatar">[justice2001](https://github.com/justice2001) 已经找到问题所在了,核心问题是PJAX跳转时会重新加载渲染脚本,但是新加载的渲染脚本会产生冲突,所以出现了这个问题。 这个问题会在下个版本修复。
zhengyi removed the
Status
Need More Info
label 2024-02-02 23:06:34 +08:00
zhengyi changed title from 在 Hao 主题下渲染代码注入时机不恰当 to 对于PJAX支持不完善的问题 2024-02-02 23:06:40 +08:00
Owner

TODO LIST

  • 为 PJAX 添加支持
  • Modify pjax.js => render.js
  • Modify render.js => render-utils.js
# TODO LIST - [x] 为 PJAX 添加支持 - [x] Modify `pjax.js` => `render.js` - [x] Modify `render.js` => `render-utils.js`
zhengyi added the
Status
Need Test
label 2024-02-03 01:45:51 +08:00
zhengyi added
Status
Wait Merge
and removed
Status
Need Test
labels 2024-02-06 16:53:02 +08:00
Author
Collaborator

comment in GitHub by user avatarHenryZeng-Zero

十分感谢

comment in [GitHub](https://github.com/justice2001/halo-plugin-vditor/issues/24#issuecomment-1956445597) by user <img style="border-radius: 50%" src="https://avatars.githubusercontent.com/u/36284614?v=4" width="20" height="20" alt="avatar">[HenryZeng-Zero](https://github.com/HenryZeng-Zero) 十分感谢
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: zhengyi/halo-plugin-vditor#59
No description provided.