Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gui] Fix exporting checker statistics to CSV #3362

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion web/server/vue-cli/src/mixins/to-csv.mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ export default {
* @param {string} fileName - default file name for export.
*/
toCSV(data, fileName) {
const content = data.map(d => d.join(",") + "\r\n").join("");
const content = data
.map(d => d.join(",") + "\r\n")
.join("")
// Hashmark (#) is a valid URL character but it starts the hash
// fragment and for this reason it needs to be escaped.
.replaceAll("#", encodeURIComponent("#"));

const csvContent = `data:text/csv;charset=utf-8,${content}`;

const link = document.createElement("a");
Expand Down