Skip to content

Commit a729e9a

Browse files
authored
Merge branch 'main' into cache_detection
2 parents fab6fc9 + 0f55c81 commit a729e9a

File tree

9 files changed

+99
-28
lines changed

9 files changed

+99
-28
lines changed

.github/pull_request_template.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Do you follow the guidelines?
1+
Have you followed these guidelines?
22

33
- [ ] I have tested my changes
44
- [ ] There are no breaking changes
5-
- [ ] I really tested my changes and there is no regression
6-
- [ ] Ideally, my commit messages follow the [Conventional Commits specification](https://www.conventionalcommits.org/)
7-
- [ ] I read this document: https://miniflux.app/faq.html#pull-request
5+
- [ ] I have thoroughly tested my changes and verified there are no regressions
6+
- [ ] My commit messages follow the [Conventional Commits specification](https://www.conventionalcommits.org/)
7+
- [ ] I have read this document: https://miniflux.app/faq.html#pull-request

.github/workflows/linters.yml

+21
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,24 @@ jobs:
4040
with:
4141
version: "2024.1.1"
4242
install-go: false
43+
44+
commitlint:
45+
name: Commit Linter
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
with:
50+
fetch-depth: 0
51+
52+
- name: Setup Node.js
53+
uses: actions/setup-node@v4
54+
with:
55+
node-version: "lts/*"
56+
57+
- name: Install commitlint
58+
run: |
59+
npm install --save-dev @commitlint/config-conventional @commitlint/cli
60+
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
61+
62+
- name: Validate PR commits
63+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

go.mod

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ require (
1212
github.com/mattn/go-sqlite3 v1.14.24
1313
github.com/prometheus/client_golang v1.20.5
1414
github.com/tdewolff/minify/v2 v2.21.3
15-
golang.org/x/crypto v0.32.0
16-
golang.org/x/image v0.23.0
15+
golang.org/x/crypto v0.33.0
16+
golang.org/x/image v0.24.0
1717
golang.org/x/net v0.34.0
18-
golang.org/x/oauth2 v0.25.0
19-
golang.org/x/term v0.28.0
18+
golang.org/x/oauth2 v0.26.0
19+
golang.org/x/term v0.29.0
2020
)
2121

2222
require (
@@ -40,8 +40,8 @@ require (
4040
github.com/prometheus/procfs v0.15.1 // indirect
4141
github.com/tdewolff/parse/v2 v2.7.19 // indirect
4242
github.com/x448/float16 v0.8.4 // indirect
43-
golang.org/x/sys v0.29.0 // indirect
44-
golang.org/x/text v0.21.0 // indirect
43+
golang.org/x/sys v0.30.0 // indirect
44+
golang.org/x/text v0.22.0 // indirect
4545
google.golang.org/protobuf v1.34.2 // indirect
4646
)
4747

go.sum

+12-11
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
7272
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
7373
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
7474
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
75-
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
76-
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
77-
golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68=
78-
golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY=
75+
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
76+
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
77+
golang.org/x/image v0.24.0 h1:AN7zRgVsbvmTfNyqIbbOraYL8mSwcKncEj8ofjgzcMQ=
78+
golang.org/x/image v0.24.0/go.mod h1:4b/ITuLfqYq1hqZcjofwctIhi7sZh2WaCjvsBNjjya8=
7979
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
8080
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
8181
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
@@ -92,8 +92,8 @@ golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
9292
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
9393
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
9494
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
95-
golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70=
96-
golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
95+
golang.org/x/oauth2 v0.26.0 h1:afQXWNNaeC4nvZ0Ed9XvCCzXM6UHJG7iCg0W4fPqSBE=
96+
golang.org/x/oauth2 v0.26.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
9797
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
9898
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
9999
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -112,8 +112,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
112112
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
113113
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
114114
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
115-
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
116-
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
115+
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
116+
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
117117
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
118118
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
119119
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -123,8 +123,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
123123
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
124124
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
125125
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
126-
golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=
127-
golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek=
126+
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
127+
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
128128
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
129129
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
130130
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
@@ -133,8 +133,9 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
133133
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
134134
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
135135
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
136-
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
137136
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
137+
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
138+
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
138139
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
139140
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
140141
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=

internal/locale/translations/de_DE.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@
503503
"form.integration.shaarli_endpoint": "Shaarli-URL",
504504
"form.integration.shaarli_api_secret": "Shaarli-API-Geheimnis",
505505
"form.integration.webhook_activate": "Webhooks aktivieren",
506-
"form.integration.webhook_url": "Standard Webhook-URL",
506+
"form.integration.webhook_url": "Standard-Webhook-URL",
507507
"form.integration.webhook_secret": "Webhook-Geheimnis",
508508
"form.integration.rssbridge_activate": "Beim Hinzufügen von Abonnements RSS-Bridge prüfen.",
509509
"form.integration.rssbridge_url": "RSS-Bridge-Server-URL",

internal/reader/date/parser.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,7 @@ func parseLocalTimeDates(layout, ds string) (t time.Time, err error) {
354354
// Workaround for dates that don't use GMT.
355355
if strings.HasSuffix(ds, "PST") || strings.HasSuffix(ds, "PDT") {
356356
loc, _ = time.LoadLocation("America/Los_Angeles")
357-
}
358-
359-
if strings.HasSuffix(ds, "EST") || strings.HasSuffix(ds, "EDT") {
357+
} else if strings.HasSuffix(ds, "EST") || strings.HasSuffix(ds, "EDT") {
360358
loc, _ = time.LoadLocation("America/New_York")
361359
}
362360

internal/reader/sanitizer/sanitizer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ var (
6666
"sup": {"id"},
6767
"table": {},
6868
"td": {"rowspan", "colspan"},
69-
"tfooter": {},
69+
"tfoot": {},
7070
"th": {"rowspan", "colspan"},
7171
"thead": {},
7272
"time": {"datetime"},

internal/reader/sanitizer/truncate.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ func TruncateHTML(input string, max int) string {
99
text := StripTags(input)
1010
text = strings.ReplaceAll(text, "\n", " ")
1111
text = strings.ReplaceAll(text, "\t", " ")
12-
text = strings.ReplaceAll(text, " ", " ")
13-
text = strings.TrimSpace(text)
12+
13+
// Collapse multiple spaces into a single space
14+
text = strings.Join(strings.Fields(text), " ")
1415

1516
// Convert to runes to be safe with unicode
1617
runes := []rune(text)

internal/reader/sanitizer/truncate_test.go

+50
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,53 @@ func TestTruncateHTMLWithMultilineTextLowerThanLimit(t *testing.T) {
6262
t.Errorf(`Wrong output: %q != %q`, expected, output)
6363
}
6464
}
65+
66+
func TestTruncateHTMLWithMultipleSpaces(t *testing.T) {
67+
tests := []struct {
68+
name string
69+
input string
70+
maxLen int
71+
expected string
72+
}{
73+
{
74+
name: "multiple spaces",
75+
input: "hello world test",
76+
maxLen: 20,
77+
expected: "hello world test",
78+
},
79+
{
80+
name: "tabs and newlines",
81+
input: "hello\t\tworld\n\ntest",
82+
maxLen: 20,
83+
expected: "hello world test",
84+
},
85+
{
86+
name: "truncation with unicode",
87+
input: "hello world 你好",
88+
maxLen: 11,
89+
expected: "hello world…",
90+
},
91+
{
92+
name: "html stripping",
93+
input: "<p>hello <b>world</b> test</p>",
94+
maxLen: 20,
95+
expected: "hello world test",
96+
},
97+
{
98+
name: "no truncation needed",
99+
input: "hello world",
100+
maxLen: 20,
101+
expected: "hello world",
102+
},
103+
}
104+
105+
for _, tt := range tests {
106+
t.Run(tt.name, func(t *testing.T) {
107+
result := TruncateHTML(tt.input, tt.maxLen)
108+
if result != tt.expected {
109+
t.Errorf("TruncateHTML(%q, %d) = %q, want %q",
110+
tt.input, tt.maxLen, result, tt.expected)
111+
}
112+
})
113+
}
114+
}

0 commit comments

Comments
 (0)