Skip to content

Commit

Permalink
fix: 修复短链接配置失效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Nov 5, 2024
1 parent effebce commit 79c34ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Cherry.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const defaultConfig = {
/** 生成的<a>标签追加rel属性的默认值 空:在<a>标签里不会追加rel属性, nofollow:在<a>标签里追加rel="nofollow:在"属性*/
rel: '',
/** 是否开启短链接 */
enableShortLink: true,
enableShortLink: false,
/** 短链接长度 */
shortLinkLength: 20,
},
Expand Down
4 changes: 2 additions & 2 deletions src/core/hooks/AutoLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ export default class AutoLink extends SyntaxBase {
}
const processedURL = this.$engine.$cherry.options.callback.urlProcessor(url, 'autolink');
const safeUri = encodeURIOnce(processedURL);
const displayUri = $e(url);
const displayUri = $e(linkText);
const additionalAttrs = [this.target, this.rel].filter(Boolean).join(' ');
return `<a href="${AutoLink.escapePreservedSymbol(safeUri)}" title="${AutoLink.escapePreservedSymbol(
displayUri,
$e(url),
)}" ${additionalAttrs}>${AutoLink.escapePreservedSymbol(displayUri)}</a>`;
}
}

0 comments on commit 79c34ca

Please sign in to comment.