Skip to content

Commit

Permalink
feat: 优化了scope_css代码
Browse files Browse the repository at this point in the history
  • Loading branch information
bailicangdu committed Dec 30, 2021
1 parent 874ce31 commit bd038e7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions dev/children/react16/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
</script> -->
<!-- <link rel="stylesheet" href="http://127.0.0.1:8080/test.css" global> -->
<!-- <script defer src="http://127.0.0.1:8080/test.js"></script> -->
<!-- <script>
console.log(6666666, this)
</script> -->
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<link rel="stylesheet" href="http://127.0.0.1:8080/test.css">
<div id="root"></div>
</body>
<script>
Expand Down
10 changes: 10 additions & 0 deletions docs/zh-cn/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@

---

### 0.7.1

`2022-01-04`

- **Bug Fix**

- 🐞 修复了link标签在非head时样式丢失的问题
- 🐞 修复了错误补全svg地址的问题。


### 0.7.0

`2021-12-29`
Expand Down
2 changes: 1 addition & 1 deletion src/source/scoped_css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function scopedHost (
linkpath?: string,
) {
return cssText.replace(/url\(["']?([^)"']+)["']?\)/gm, (all, $1) => {
if (/^(data|blob):|#/.test($1)) {
if (/^((data|blob):|#)/.test($1)) {
return all
} else if (/^(https?:)?\/\//.test($1)) {
if (isSafari()) {
Expand Down

0 comments on commit bd038e7

Please sign in to comment.