Skip to content

Commit 7b283c0

Browse files
committed
feat(curl-parser): 支持多 Shell 格式兼容(Bash/CMD/PowerShell)
- 新增 Shell 类型自动检测功能 - 支持不同 Shell 的续行符和转义字符处理 - CMD 格式支持 ^& ^% ^" ^! 等特殊转义 - 解析结果显示 Shell 类型标签 - 代码生成页面新增"生成代码"按钮 - 修复移动端首页版本号和更新日志按钮文字不显示的问题
1 parent f46be69 commit 7b283c0

9 files changed

Lines changed: 322 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@
99
格式基于 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.0.0/)
1010
并且本项目遵循 [语义化版本](https://semver.org/lang/zh-CN/)
1111

12+
## [1.0.8] - 2026-01-12
13+
14+
### 新增
15+
- **cURL 解析器** - 多 Shell 格式兼容
16+
- 支持自动检测 Shell 类型:Bash、CMD、PowerShell
17+
- 正确处理不同 Shell 的续行符:`\`(Bash)、`^`(CMD)、`` ` ``(PowerShell)
18+
- 支持 CMD 特殊转义:`^&``^%``^"``^!`
19+
- 解析结果显示检测到的 Shell 类型标签
20+
- **代码生成** - 新增"生成代码"按钮,首次粘贴 cURL 命令后点击按钮即可生成代码
21+
22+
### 修复
23+
- 修复移动端首页版本号和更新日志按钮文字不显示的问题
24+
25+
---
26+
1227
## [1.0.7] - 2026-01-12
1328

1429
### 新增

CHANGELOG_EN.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ All notable changes to this project will be documented in this file.
99
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1010
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1111

12+
## [1.0.8] - 2026-01-12
13+
14+
### Added
15+
- **cURL Parser** - Multi-shell format compatibility
16+
- Auto-detect shell type: Bash, CMD, PowerShell
17+
- Correctly handle different shell line continuation characters: `\` (Bash), `^` (CMD), `` ` `` (PowerShell)
18+
- Support CMD special escapes: `^&`, `^%`, `^"`, `^!`, etc.
19+
- Display detected shell type badge in parse results
20+
- **Code Generator** - Added "Generate Code" button for first-time code generation after pasting cURL command
21+
22+
### Fixed
23+
- Fixed version number and changelog button text not showing on mobile homepage
24+
25+
---
26+
1227
## [1.0.7] - 2026-01-12
1328

1429
### Added

assets/css/main.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,8 @@ ol {
15181518
font-size: 11px;
15191519
}
15201520

1521-
.github-stat-badge span:not(.github-stat-count) {
1521+
/* 只隐藏 Star/Fork 徽章的文字,保留版本和更新日志文字 */
1522+
.github-stats:not(.github-stats--secondary) .github-stat-badge span:not(.github-stat-count) {
15221523
display: none;
15231524
}
15241525

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reverse-engineering-online-toolkit",
3-
"version": "1.0.1",
3+
"version": "1.0.8",
44
"description": "纯前端逆向工程在线工具箱 - A pure frontend reverse engineering online toolkit",
55
"main": "index.html",
66
"scripts": {

tools/network/curl-converter/curl-converter.css

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,47 @@
273273
.method-badge.HEAD { background: #6b7280; color: white; }
274274
.method-badge.OPTIONS { background: #ec4899; color: white; }
275275

276+
/* Shell 类型标签 */
277+
.shell-badge {
278+
display: inline-block;
279+
padding: 2px 8px;
280+
border-radius: 4px;
281+
font-weight: 600;
282+
font-size: 0.85rem;
283+
width: fit-content;
284+
}
285+
286+
.shell-badge.shell-bash {
287+
background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
288+
color: #dfe6e9;
289+
}
290+
291+
.shell-badge.shell-cmd {
292+
background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
293+
color: white;
294+
}
295+
296+
.shell-badge.shell-powershell {
297+
background: linear-gradient(135deg, #012456 0%, #1e3a5f 100%);
298+
color: #89d4f5;
299+
}
300+
301+
/* 暗色主题下的 Shell 标签 */
302+
[data-theme="dark"] .shell-badge.shell-bash {
303+
background: linear-gradient(135deg, #636e72 0%, #b2bec3 100%);
304+
color: #2d3436;
305+
}
306+
307+
[data-theme="dark"] .shell-badge.shell-cmd {
308+
background: linear-gradient(135deg, #0078d4 0%, #4fc3f7 100%);
309+
color: white;
310+
}
311+
312+
[data-theme="dark"] .shell-badge.shell-powershell {
313+
background: linear-gradient(135deg, #1e3a5f 0%, #5e81ac 100%);
314+
color: #eceff4;
315+
}
316+
276317
.url-value {
277318
color: var(--color-primary);
278319
}

tools/network/curl-converter/curl-converter.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ <h3 data-i18n="tools.curl-converter.overview">请求概览</h3>
7676
<span class="overview-label" data-i18n="tools.curl-converter.method">方法</span>
7777
<span class="overview-value method-badge" id="overview-method">GET</span>
7878
</div>
79+
<div class="overview-item">
80+
<span class="overview-label" data-i18n="tools.curl-converter.shellType">Shell 类型</span>
81+
<span class="overview-value shell-badge" id="overview-shell">Bash</span>
82+
</div>
7983
<div class="overview-item overview-item--wide">
8084
<span class="overview-label" data-i18n="tools.curl-converter.url">URL</span>
8185
<span class="overview-value url-value" id="overview-url">-</span>
@@ -405,6 +409,15 @@ <h3 class="feature-intro__title" data-i18n="tools.curl-converter.intro.generate.
405409
</select>
406410
</div>
407411

412+
<!-- 生成按钮 -->
413+
<button id="gen-code-btn" class="btn btn--primary btn--settings-text" data-i18n="tools.curl-converter.generateCode">
414+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
415+
<polyline points="16 18 22 12 16 6"></polyline>
416+
<polyline points="8 6 2 12 8 18"></polyline>
417+
</svg>
418+
<span data-i18n="tools.curl-converter.generateCode">生成代码</span>
419+
</button>
420+
408421
<!-- 设置按钮与浮动面板 -->
409422
<div class="gen-options-wrapper">
410423
<button id="gen-options-toggle" class="btn btn--outline btn--settings-text" title="代码生成选项" data-i18n-title="tools.curl-converter.options.title">

0 commit comments

Comments
 (0)