From 41e6c78bdb5546003ebb66bbf83a68464506a739 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 26 Apr 2024 23:11:52 +0800 Subject: [PATCH] :art: link text --- app/src/constants.ts | 2 +- app/src/menus/protyle.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/constants.ts b/app/src/constants.ts index 5f87f49d2..ea369e44f 100644 --- a/app/src/constants.ts +++ b/app/src/constants.ts @@ -67,7 +67,7 @@ export abstract class Constants { // size public static readonly SIZE_SCROLL_TB: number = 24; public static readonly SIZE_SCROLL_STEP: number = 256; - public static readonly SIZE_LINK_TEXT_MAX: number = 24; + public static readonly SIZE_LINK_TEXT_MAX: number = 64; public static readonly SIZE_TOOLBAR_HEIGHT: number = isMobile() ? 0 : 32; public static readonly SIZE_GET_MAX = 102400; public static readonly SIZE_UNDO = 64; diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index 2887b5210..b33579aff 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -1160,7 +1160,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText let anchor = linkElement.textContent.replace(Constants.ZWSP, ""); if (!anchor && linkAddress) { anchor = linkAddress.replace("https://", "").replace("http://", ""); - if (anchor.length > 24) { + if (anchor.length > Constants.SIZE_LINK_TEXT_MAX) { anchor = anchor.substring(0, Constants.SIZE_LINK_TEXT_MAX) + "..."; } linkElement.innerHTML = Lute.EscapeHTMLStr(anchor);