From a045989c15b38a3d95084fc44e18641c304c966c Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 14 Aug 2022 12:58:48 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=BC=95=E7=94=A8=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=B8=AD=E5=B1=9E=E6=80=A7=E3=80=81=E5=86=85=E5=AE=B9=E8=BD=AC?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/protyle/hint/extend.ts | 18 +++++++++--------- app/src/protyle/hint/index.ts | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/src/protyle/hint/extend.ts b/app/src/protyle/hint/extend.ts index 8dca51229..1d2fe0c5d 100644 --- a/app/src/protyle/hint/extend.ts +++ b/app/src/protyle/hint/extend.ts @@ -307,13 +307,13 @@ export const hintRef = (key: string, protyle: IProtyle, isQuick = false): IHintD const iconName = getIconByType(item.type); let attrHTML = ""; if (item.name) { - attrHTML += ` ${item.name}`; + attrHTML += ` ${escapeHtml(item.name)}`; } if (item.alias) { - attrHTML += ` ${item.alias}`; + attrHTML += ` ${escapeHtml(item.alias)}`; } if (item.memo) { - attrHTML += ` ${item.memo}`; + attrHTML += ` ${escapeHtml(item.memo)}`; } if (attrHTML) { attrHTML = `
${attrHTML}
`; @@ -326,9 +326,9 @@ export const hintRef = (key: string, protyle: IProtyle, isQuick = false): IHintD value, html: `${attrHTML}
- ${item.content} + ${escapeHtml(item.content)}
-
${escapeHtml(item.hPath)}
`, +
${item.hPath}
`, }); }); if (isQuick) { @@ -363,13 +363,13 @@ export const hintEmbed = (key: string, protyle: IProtyle): IHintData[] => { const iconName = getIconByType(item.type); let attrHTML = ""; if (item.name) { - attrHTML += ` ${item.name}`; + attrHTML += ` ${escapeHtml(item.name)}`; } if (item.alias) { - attrHTML += ` ${item.alias}`; + attrHTML += ` ${escapeHtml(item.alias)}`; } if (item.memo) { - attrHTML += ` ${item.memo}`; + attrHTML += ` ${escapeHtml(item.memo)}`; } if (attrHTML) { attrHTML = `
${attrHTML}
`; @@ -378,7 +378,7 @@ export const hintEmbed = (key: string, protyle: IProtyle): IHintData[] => { value: `{{select * from blocks where id='${item.id}'}}`, html: `${attrHTML}
- ${item.content} + ${escapeHtml(item.content)}
${item.hPath}
`, }); diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts index 1fed739bf..11ea7f02d 100644 --- a/app/src/protyle/hint/index.ts +++ b/app/src/protyle/hint/index.ts @@ -297,13 +297,13 @@ ${unicode2Emoji(emoji.unicode, true)}`; const iconName = getIconByType(item.type); let attrHTML = ""; if (item.name) { - attrHTML += ` ${item.name}`; + attrHTML += ` ${escapeHtml(item.name)}`; } if (item.alias) { - attrHTML += ` ${item.alias}`; + attrHTML += ` ${escapeHtml(item.alias)}`; } if (item.memo) { - attrHTML += ` ${item.memo}`; + attrHTML += ` ${escapeHtml(item.memo)}`; } if (attrHTML) { attrHTML = `
${attrHTML}
`; @@ -311,9 +311,9 @@ ${unicode2Emoji(emoji.unicode, true)}`; const blockRefHTML = `${oldValue}`; searchHTML += ``; +
${item.hPath}
`; }); if (searchHTML === "") { searchHTML = ``;