Merge pull request #316 from answerdev/feat/1.0.8/ui

Feat/1.0.8/UI
This commit is contained in:
dashuai 2023-04-10 16:25:43 +08:00 committed by GitHub
commit ead0a3d076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -32,7 +32,7 @@ const ActivateScriptNodes = (el, part) => {
scriptList.push(node);
}
}
scriptList.forEach((so) => {
scriptList?.forEach((so) => {
const script = document.createElement('script');
script.text = so.text;
for (let i = 0; i < so.attributes.length; i += 1) {

View File

@ -146,7 +146,8 @@ export function htmlRender(el: HTMLElement | null) {
el.querySelectorAll('a').forEach((a) => {
const base = window.location.origin;
const targetUrl = new URL(a.href, base);
if (targetUrl.toString() !== window.location.href) {
if (targetUrl.origin !== base) {
a.rel = 'nofollow';
}
});

View File

@ -20,7 +20,7 @@ const tagEdit = (tagId: string) => {
const questionLanding = (questionId: string, slugTitle: string = '') => {
const { seo } = seoSettingStore.getState();
if (!questionId) {
return slugTitle ? `/questions/null/slugTitle` : '/questions/null';
return slugTitle ? `/questions/null/${slugTitle}` : '/questions/null';
}
// @ts-ignore
if (/[13]/.test(seo.permalink) && slugTitle) {