generated from Seekra/repository-template
style: format code using Prettier
This commit is contained in:
@@ -30,15 +30,16 @@ const fetchHtml = async function fetchHtml(url, options) {
|
||||
};
|
||||
|
||||
export const getLegalNotice = async function getLegalNotice() {
|
||||
const legalNoticeUrl = new URL('legal/legal_notice.html', getAssetsUrl()).href;
|
||||
const legalNoticeUrl = new URL('legal/legal_notice.html', getAssetsUrl())
|
||||
.href;
|
||||
const html = await fetchHtml(legalNoticeUrl);
|
||||
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(html, 'text/html');
|
||||
|
||||
const legalNoticeContainer = doc.querySelector('main') ?? doc.body;
|
||||
legalNoticeContainer.querySelectorAll('a').forEach(
|
||||
(link) => link.classList.add('link')
|
||||
);
|
||||
legalNoticeContainer
|
||||
.querySelectorAll('a')
|
||||
.forEach((link) => link.classList.add('link'));
|
||||
return legalNoticeContainer.innerHTML;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user