diff --git a/src/js/support.js b/src/js/support.js
index 4b051ca85..88a26bceb 100644
--- a/src/js/support.js
+++ b/src/js/support.js
@@ -114,10 +114,13 @@ function patchEmptiness(data, prop) {
}
function addDetailsToReportURL(id) {
- const text = cmEditor.getValue();
+ const text = cmEditor.getValue().replace(/^ /gm, '');
const elem = uDom.nodeFromId(id);
const url = new URL(elem.getAttribute('data-url'));
- url.searchParams.set('configuration', `\n\n${text}\n `);
+ url.searchParams.set(
+ 'configuration',
+ '\n\n```yaml\n' + text + '\n```\n '
+ );
elem.setAttribute('data-url', url);
}
@@ -138,7 +141,7 @@ function showData() {
return v
.replace( /^( *)"/, ' $1')
.replace( /^( +.*[^\\])(?:": "|": \{$|": \[$|": )/, '$1: ')
- .replace( /(?:"|"|\}|\]),?$/, '');
+ .replace( /(?:",?|\},?|\],?|,)$/, '');
})
.filter(v => v.trim() !== '')
.join('\n') + '\n';