8000 [pull] master from tdewolff:master by pull[bot] · Pull Request #278 · kokizzu/minify · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version: '>=1.23'
go-version: '>=1.25'
- name: Build Windows extension
run: |
set GOOS=windows
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version: '>=1.23'
go-version: '>=1.25'
- name: Build MacOS extension
run: |
export GOOS=darwin
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
python-version: '3.13'
- uses: actions/setup-go@v6
with:
go-version: '>=1.23'
go-version: '>=1.25'
- name: Install dependencies
run: pip install build
- name: Build package
Expand Down
7 changes: 4 additions & 3 deletions css/css_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ func TestCSS(t *testing.T) {
{"a{@media screen and (min-width:1024px){ width: 40%; } & h1 { font-size: clamp(2.5rem, 1rem + 3vw, 3.5rem)}}", "a{@media screen and (min-width:1024px){width: 40%;}& h1{font-size:clamp(2.5rem,1rem + 3vw,3.5rem)}}"}, // #602
{"a{padding:calc(var(--dce-edge-xsmall,6px) - 2px) calc(var(--dce-button-horizontal-padding,18px) - 2px)}", "a{padding:calc(var(--dce-edge-xsmall,6px) - 2px)calc(var(--dce-button-horizontal-padding,18px) - 2px)}"}, // #673
{"a{border-color:var(--dce-brand-color,#01A982)var(--dce-brand-color,#01A982)var(--dce-border-weak,#0000001F)}", "a{border-color:var(--dce-brand-color,#01A982)var(--dce-brand-color,#01A982)var(--dce-border-weak,#0000001F)}"}, // #673
{"--custom:calc(var(--a) + var(--b))", "--custom:calc(var(--a) + var(--b))"}, // #784
{"a{& :is(b) {c:d;} }", "a{& :is(b){c:d}}"}, // #908
{"a{&:is(b) :is(c) {d:e;} }", "a{&:is(b) :is(c){d:e}}"}, // #908
{"--custom:calc(var(--a) + var(--b))", "--custom:calc(var(--a) + var(--b))"}, // #784
{"a{& :is(b) {c:d;} }", "a{& :is(b){c:d}}"}, // #908
{"a{&:is(b) :is(c) {d:e;} }", "a{&:is(b) :is(c){d:e}}"}, // #908
{"@scope (body) { :scope { color: red; } }", "@scope(body){:scope{color:red}}"}, // #968
}

m := minify.New()
Expand Down
2 changes: 2 additions & 0 deletions minify.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ func (m *M) AddRegexp(pattern *regexp.Regexp, minifier Minifier) {
for i := range m.pattern {
if m.pattern[i].pattern.String() == pattern.String() {
m.pattern[i] = patternMinifier{pattern, minifier}
m.mutex.Unlock()
return
}
}
Expand All @@ -169,6 +170,7 @@ func (m *M) AddFuncRegexp(pattern *regexp.Regexp, minifier MinifierFunc) {
for i := range m.pattern {
if m.pattern[i].pattern.String() == pattern.String() {
m.pattern[i] = patternMinifier{pattern, minifier}
m.mutex.Unlock()
return
}
}
Expand Down
Loading
0