File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1-
21▗▄▄▄▖▗▖ ▗▖▗▄▄▖ ▗▄▄▄▖ ▗▄▄▖ ▗▄▄▖▗▄▄▖ ▗▄▄▄▖▗▄▄▖▗▄▄▄▖
32 █ ▝▚▞▘ ▐▌ ▐▌▐▌ ▐▌ ▐▌ ▐▌ ▐▌ █ ▐▌ ▐▌ █
43 █ ▐▌ ▐▛▀▘ ▐▛▀▀▘ ▝▀▚▖▐▌ ▐▛▀▚▖ █ ▐▛▀▘ █
Original file line number Diff line number Diff line change @@ -46,7 +46,17 @@ module.exports = {
4646 banner = banner . replaceAll ( "${document}" , webpackPackageJson [ "document" ] || "" ) ;
4747 banner = banner . replaceAll ( "${author}" , webpackPackageJson [ "author" ] || "" ) ;
4848 banner = banner . replaceAll ( "${repository}" , webpackPackageJson [ "repository" ] || "" ) ;
49- userscriptHeaders += "\n" + banner . split ( "\n" ) . join ( "\n// " ) + "\n" ;
49+
50+ // 修复:确保在油猴头部注释和banner之间有足够的空行
51+ // 添加两个换行,确保脚本头注释和实际代码之间有明确的分隔
52+ // 修复:确保每一行都添加注释前缀,包括第一行
53+ userscriptHeaders += "\n\n" ;
54+
55+ // 处理每一行,确保每一行都有注释前缀
56+ const bannerLines = banner . split ( "\n" ) ;
57+ const commentedBanner = bannerLines . map ( line => "// " + line ) . join ( "\n" ) ;
58+
59+ userscriptHeaders += commentedBanner + "\n" ;
5060 }
5161
5262 return userscriptHeaders ;
You can’t perform that action at this time.
0 commit comments