File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
utils/httpRequestParser/parsers Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -337,6 +337,7 @@ function createEditorState(content: string): EditorState {
337337 highlightSelectionMatches (),
338338 syntaxHighlighting (httpHighlightStyle ),
339339 httpLanguage ,
340+ EditorView .lineWrapping , // 启用软换行,防止长行撑开容器
340341 themeCompartment .of (getCurrentTheme ()),
341342 keymap .of ([
342343 ... defaultKeymap ,
Original file line number Diff line number Diff line change @@ -145,11 +145,15 @@ export function parseCurlCmd(input: string): ParsedHttpRequest | null {
145145 // Step 5: 处理剩余的 ^^ => ^ (转义的脱字符本身)
146146 normalized = normalized . replace ( / \^ \^ / g, '^' )
147147
148+ // Step 6: 移除非ASCII字符(中文等)前的 ^
149+ // Windows CMD 中 ^ 也用于转义中文等多字节字符,如 ^电^话 => 电话
150+ normalized = normalized . replace ( / \^ ( [ ^ \x00 - \x7F ] ) / g, '$1' )
151+
148152 // 使用库解析标准化后的 cURL 命令
149153 const result = parseCurlWithLib ( normalized )
150154
151155 if ( result ) {
152- // Step 6 : 恢复占位符为实际的引号字符
156+ // Step 7 : 恢复占位符为实际的引号字符
153157 const restorePlaceholder = ( str : string ) =>
154158 str . replace ( new RegExp ( NESTED_QUOTE_PLACEHOLDER , 'g' ) , '"' )
155159
You can’t perform that action at this time.
0 commit comments