mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 link text
This commit is contained in:
parent
e831f07eb2
commit
41e6c78bdb
2 changed files with 2 additions and 2 deletions
|
|
@ -67,7 +67,7 @@ export abstract class Constants {
|
||||||
// size
|
// size
|
||||||
public static readonly SIZE_SCROLL_TB: number = 24;
|
public static readonly SIZE_SCROLL_TB: number = 24;
|
||||||
public static readonly SIZE_SCROLL_STEP: number = 256;
|
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_TOOLBAR_HEIGHT: number = isMobile() ? 0 : 32;
|
||||||
public static readonly SIZE_GET_MAX = 102400;
|
public static readonly SIZE_GET_MAX = 102400;
|
||||||
public static readonly SIZE_UNDO = 64;
|
public static readonly SIZE_UNDO = 64;
|
||||||
|
|
|
||||||
|
|
@ -1160,7 +1160,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
|
||||||
let anchor = linkElement.textContent.replace(Constants.ZWSP, "");
|
let anchor = linkElement.textContent.replace(Constants.ZWSP, "");
|
||||||
if (!anchor && linkAddress) {
|
if (!anchor && linkAddress) {
|
||||||
anchor = linkAddress.replace("https://", "").replace("http://", "");
|
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) + "...";
|
anchor = anchor.substring(0, Constants.SIZE_LINK_TEXT_MAX) + "...";
|
||||||
}
|
}
|
||||||
linkElement.innerHTML = Lute.EscapeHTMLStr(anchor);
|
linkElement.innerHTML = Lute.EscapeHTMLStr(anchor);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue