We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec6b9fb commit bb8d939Copy full SHA for bb8d939
src/components/ChallengeContributePage/handleImportYaml.tsx
@@ -306,6 +306,17 @@ export function updateChallengeInCollection(
306
updatedLines.push(`${indent} - ${solution}`);
307
});
308
}
309
+ } else {
310
+ // 处理所有其他普通字段
311
+ if (typeof fieldValue === 'string' || typeof fieldValue === 'number' || typeof fieldValue === 'boolean') {
312
+ updatedLines.push(`${indent} ${fieldName}: ${fieldValue}`);
313
+ } else if (fieldValue === null || fieldValue === undefined) {
314
+ // 跳过空值
315
+ return;
316
317
+ // 对于复杂对象,使用YAML.stringify
318
+ updatedLines.push(`${indent} ${fieldName}: ${YAML.stringify(fieldValue)}`);
319
+ }
320
321
322
0 commit comments