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

关于 Prism 的两个问题 #5305

Open
Moushudyx opened this issue Feb 25, 2023 · 1 comment
Open

关于 Prism 的两个问题 #5305

Moushudyx opened this issue Feb 25, 2023 · 1 comment

Comments

@Moushudyx
Copy link

问题描述

wangEditor 5 引入了 Prism,这会导致两个问题:

  1. 如果使用 wangEditor 的工程用别的方法引入了 Prism(最简单的复现是直接引入Prism 官网下载的源码),就会发生互相覆盖的情况
  2. wangEditor 的 Prism 引入了 php 的同时没有引入 markup-templating,在部分 Prism 版本(比如 1.29)会导致 #1400 ,不过这个应该算是 Prism 的问题

触发这两个问题不需要真的用到 wangEditor 5 的代码高亮功能,只要引入 wangEditor 5 即可;触发第二条的报错也不需要去高亮 php 代码,随便高亮什么代码都行。

我知道这两个问题是因为我全踩了,修了一上午

wangEditor 版本

5.1.23

是否查阅了文档 ?

是,我还把相关源码翻了一圈

最小成本的复现步骤

  • 在项目中引入 wangEditor 5
  • 在网页中用script或其他方法引入 Prism
  • window.Prism.highlightAllUnder随便高亮什么代码
    • 可能性一:由其他方法引入的 Prism 覆盖了 wangEditor 5 的 Prism,wangEditor 5 的 代码高亮可能出现问题
    • 可能性二: wangEditor 5 的 Prism 覆盖了由其他方法引入的 Prism,预期引入的其他语言高亮功能失效;如果用了部分版本的 Prism(比如 1.29),则可能发生 #1400 问题(如果单纯想复现这个问题,可以将“引入别的 Prism”这一步省去)
@weijiang1994
Copy link

请问这个问题解决吗?

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

2 participants