File tree Expand file tree Collapse file tree 5 files changed +877
-61
lines changed
src/components/ChallengeContributePage Expand file tree Collapse file tree 5 files changed +877
-61
lines changed Original file line number Diff line number Diff line change @@ -98,3 +98,7 @@ challenges:
98
98
# 记录挑战最后修改时间,格式与create-time相同
99
99
# 当任何字段变更时需同步更新此时间
100
100
update-time : 2025-03-01 20:42:17
101
+
102
+ # 是否忽略该挑战
103
+ # 设置为true时,该挑战不会在列表中显示,并且编译构建时也会忽略不会被打包
104
+ ignored : true
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ const YamlPreviewSection: React.FC<YamlPreviewSectionProps> = ({
65
65
} , [ yamlOutput ] ) ;
66
66
67
67
const showModal = ( ) => {
68
+ console . log ( '正在生成YAML预览,确保保留注释...' ) ;
68
69
onGenerateYaml ( ) ; // 先生成YAML
69
70
setIsModalVisible ( true ) ;
70
71
} ;
@@ -237,6 +238,19 @@ const YamlPreviewSection: React.FC<YamlPreviewSectionProps> = ({
237
238
>
238
239
New Issue
239
240
</ Button >
241
+
242
+ { /* 调试按钮,仅在开发环境显示 */ }
243
+ { process . env . NODE_ENV === 'development' && (
244
+ < Button
245
+ onClick = { ( ) => {
246
+ console . log ( '调试:原始YAML内容' , yamlOutput ) ;
247
+ message . info ( '已在控制台输出调试信息' ) ;
248
+ } }
249
+ type = "dashed"
250
+ >
251
+ 调试
252
+ </ Button >
253
+ ) }
240
254
</ Space >
241
255
</ div >
242
256
@@ -250,26 +264,25 @@ const YamlPreviewSection: React.FC<YamlPreviewSectionProps> = ({
250
264
< Button key = "cancel" onClick = { handleCancel } >
251
265
关闭
252
266
</ Button > ,
253
- < Button key = "copy" type = "primary" icon = { < CopyOutlined /> } onClick = { handleCopyAndClose } >
254
- 复制
267
+ < Button key = "copy" type = "primary" onClick = { handleCopyAndClose } >
268
+ 复制并关闭
255
269
</ Button >
256
270
] }
257
271
>
258
- < div style = { { padding : '8px 0 ' } } >
259
- < SyntaxHighlighter
260
- language = "yaml"
272
+ < div style = { { maxHeight : '70vh' , overflowY : 'auto ' } } >
273
+ < SyntaxHighlighter
274
+ language = "yaml"
261
275
style = { highlightTheme }
262
- customStyle = { {
263
- borderRadius : '4px' ,
264
- fontSize : '14px' ,
265
- lineHeight : '1.5' ,
266
- maxHeight : '60vh' ,
267
- overflow : 'auto' ,
276
+ customStyle = { {
277
+ fontSize : '14px' ,
278
+ lineHeight : '1.5' ,
268
279
padding : '16px' ,
269
- border : '1px solid #eaeaea'
280
+ whiteSpace : 'pre-wrap' ,
281
+ overflowWrap : 'break-word'
270
282
} }
271
283
showLineNumbers = { true }
272
- wrapLongLines = { true }
284
+ wrapLines = { true }
285
+ preserveWhitespace = { true }
273
286
>
274
287
{ yamlOutput }
275
288
</ SyntaxHighlighter >
You can’t perform that action at this time.
0 commit comments