Skip to content

html代码块中scipt标签解析错误,已允许代码块内脚本 #12921

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

Closed
3 tasks done
wish5115 opened this issue Oct 26, 2024 · 9 comments
Closed
3 tasks done

html代码块中scipt标签解析错误,已允许代码块内脚本 #12921

wish5115 opened this issue Oct 26, 2024 · 9 comments

Comments

@wish5115
Copy link

wish5115 commented Oct 26, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

已开启HTML代码块内脚本选项。

当在html代码块中输入<script>xxxx</script>等内容时,script标签解析错误,如图
image

生成的代码中,不仅两处,还多出了</script></div>内容,导致script内的脚本报错无法执行。
image

关联帖子:https://ld246.com/article/1729935510467/comment/1729948008065?r=wilsons#comments

Expected result

期望能正常生成script脚本内容

Screenshot or screen recording presentation

No response

Version environment

- Version: 3.1.10
- Operating System: macos
- Browser (if used): not use

Log file

no

More information

No response

@88250
Copy link
Member

88250 commented Oct 26, 2024

我这里测试正常:

image

我是一次性外面写好然后粘贴进去的。

@TCOTC
Copy link
Contributor

TCOTC commented Oct 26, 2024

我这里逐个字符输入也正常,而且在 alert(1) 之后每输入一个字符都会弹一次窗口,看起来没问题

@88250
Copy link
Member

88250 commented Oct 26, 2024

弹窗是正常的……

@wish5115
Copy link
Author

我这里测试正常:

我是一次性外面写好然后粘贴进去的。

我知道了,这个html代码块是实时解析的,在解析过程中出现的问题,导致我后面怎么改都有问题,我是先粘贴网上的代码,再修改的,刚才的测试代码删了,无法重现刚才的问题了。

现在测试外面编辑好是没问题的。

@88250
Copy link
Member

88250 commented Oct 26, 2024

好的,那就这样吧,我关闭了。

@88250 88250 closed this as completed Oct 26, 2024
@TCOTC
Copy link
Contributor

TCOTC commented Oct 26, 2024

在解析过程中出现的问题,导致我后面怎么改都有问题

我这里也是控制台报错之后就会一直报错

@wish5115
Copy link
Author

wish5115 commented Oct 26, 2024

Quote reply

嗯,再有问题再说。

我这里也是控制台报错之后就会一直报错

@TCOTC 可以研究下能否稳定重现。

@TCOTC
Copy link
Contributor

TCOTC commented Oct 26, 2024

咋还会引用 Quote reply 的,是 GitHub 的问题吗

image

@wish5115
Copy link
Author

咋还会引用 Quote reply 的,是 GitHub 的问题吗

不清楚耶,刚才点引用回复,就这样了

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

3 participants