1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 07:22:28 +02:00

Further fine tune Support pane

Related commit:
- a3a43c7cb4
This commit is contained in:
Raymond Hill 2021-10-16 08:43:31 -04:00
parent cd5f58779b
commit c44117aa70
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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', `<details>\n\n${text}\n</details>`);
url.searchParams.set(
'configuration',
'<details>\n\n```yaml\n' + text + '\n```\n</details>'
);
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';