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

fix: 修复script脚本属性丢失的问题 #472

Merged
merged 1 commit into from
Mar 24, 2023
Merged

Conversation

yiludege
Copy link
Collaborator

  • 提交符合commit规范
  • 文档更改
  • 测试用例添加
  • npm run test通过
详细描述
  • 特性
    不管是外联脚本还是动态脚本,无界会将这些脚本转化为内联脚本,并且在这个过程中抛弃了原始脚本上的属性,比如id、data-xxx等等,本次pr会将原始属性保留到内联脚本中,比如:
<script id="myscript" data-message="hello" src="xxxxxxx"></script>

会最终转化成:

<script id="myscript" data-message="hello"> yyyyyyy </script>

可以通过 document.getElementByid(myscript) 或者 document.querySelector('#myscript')获取转化后的脚本

@yiludege yiludege merged commit 300f4a7 into master Mar 24, 2023
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

Successfully merging this pull request may close these issues.

1 participant