mirror of https://gitee.com/answerdev/answer.git
commit
ead0a3d076
|
@ -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) {
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue