Skip to content

Commit 8b8e70f

Browse files
committed
fix: properly encode JSON data in data URL for download link
- Add encodeURIComponent to JSON.stringify in data URL - Include charset=utf-8 for proper character encoding - Fixes issue #174 where special characters in JSON output caused broken download links
1 parent fb6b0a7 commit 8b8e70f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

web/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function App() {
103103
</ul>
104104
<Summary data={validation.summary} />
105105
<a
106-
href={`data:application/json:${JSON.stringify(validation)}`}
106+
href={`data:application/json;charset=utf-8,${encodeURIComponent(JSON.stringify(validation))}`}
107107
target="_blank"
108108
download="bids-validator-output.json"
109109
>

0 commit comments

Comments
 (0)