(fix) docs: パス決定を余分に行わないように

This commit is contained in:
kakkokari-gtyih 2024-01-30 13:03:22 +09:00
parent 099f3c9cb6
commit 79a1cb0ee4
2 changed files with 20 additions and 7 deletions

View File

@ -174,4 +174,9 @@ html.light .markdown-body {
.markdown-body > ol , .markdown-body > ol ,
.markdown-body :not(.ignore) ol { .markdown-body :not(.ignore) ol {
list-style: decimal; list-style: decimal;
} }
.markdown-body u {
text-decoration: underline;
text-underline-offset: .2em;
}

View File

@ -26,19 +26,27 @@ const realHref = ref(props.href);
const realTarget = ref(props.target); const realTarget = ref(props.target);
const url = parseURL(realHref.value); const url = parseURL(realHref.value);
let pathDetermined = false;
if (isLocalPath(realHref.value)) { if (isLocalPath(realHref.value)) {
// trailing slash // trailing slash
if (isRelative(realHref.value) && route.meta.__isDocsIndexPage !== true) { if (isRelative(realHref.value) && route.meta.__isDocsIndexPage !== true) {
realHref.value = joinURL('../', realHref.value.replace(/^\.\//, '')); realHref.value = joinURL('../', realHref.value.replace(/^\.\//, ''));
const resolved = resolve(realHref.value);
if (resolved.name && resolved.name.toString().includes('___')) {
//
pathDetermined = true;
}
} }
// if (!pathDetermined) {
if (/^\/[a-z]{2}\//.test(realHref.value)) { //
realHref.value = sanitizeInternalPath(realHref.value); if (/^\/[a-z]{2}\//.test(realHref.value)) {
} else { realHref.value = sanitizeInternalPath(realHref.value);
// } else {
realHref.value = sanitizeInternalPath(localePath(resolve(realHref.value).fullPath)); //
realHref.value = sanitizeInternalPath(localePath(resolve(realHref.value).fullPath));
}
} }
} else if (rootDomain.host !== url.host) { } else if (rootDomain.host !== url.host) {
realTarget.value = '_blank'; realTarget.value = '_blank';