Skip to content

Commit 49cfd6e

Browse files
committed
fix: further improve the code and execution result's output format
1 parent 78e4ecf commit 49cfd6e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/userscript/src/exporter/html.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ const transformContent = (
9393
case 'text':
9494
return content.parts?.join('\n') || ''
9595
case 'code':
96-
return content.text || ''
96+
return `Code:\n\`\`\`\n${content.text}\n\`\`\`` || ''
9797
case 'execution_output':
98-
return content.text || ''
98+
return `Result:\n\`\`\`\n${content.text}\n\`\`\`` || ''
9999
case 'tether_quote':
100100
return `> ${content.title || content.text || ''}`
101101
case 'tether_browsing_code':

packages/userscript/src/exporter/markdown.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ const transformContent = (
8888
case 'text':
8989
return content.parts?.join('\n') || ''
9090
case 'code':
91-
return content.text || ''
91+
return `Code:\n\`\`\`\n${content.text}\n\`\`\`` || ''
9292
case 'execution_output':
93-
return content.text || ''
93+
return `Result:\n\`\`\`\n${content.text}\n\`\`\`` || ''
9494
case 'tether_quote':
9595
return `> ${content.title || content.text || ''}`
9696
case 'tether_browsing_code':

0 commit comments

Comments
 (0)