chore: Shows articles in dark mode for widget (#8115)

This commit is contained in:
Nithin David Thomas
2023-10-16 16:59:15 +05:30
committed by GitHub
parent b28721e10b
commit 28db18ebbd
2 changed files with 12 additions and 6 deletions

View File

@@ -60,10 +60,10 @@ export const InitializationHelpers = {
appendPlainParamToURLs: () => {
document.getElementsByTagName('a').forEach(aTagElement => {
if (aTagElement.href && aTagElement.href.includes('/hc/')) {
aTagElement.setAttribute(
'href',
aTagElement.href + '?show_plain_layout=true'
);
const url = new URL(aTagElement.href);
url.searchParams.set('show_plain_layout', 'true');
aTagElement.setAttribute('href', url);
}
});
},