diff --git a/app/src/protyle/render/av/blockAttr.ts b/app/src/protyle/render/av/blockAttr.ts
index 8bcd17b91..ce0618cc1 100644
--- a/app/src/protyle/render/av/blockAttr.ts
+++ b/app/src/protyle/render/av/blockAttr.ts
@@ -107,12 +107,12 @@ export const genAVValueHTML = (value: IAVCellValue) => {
case "url":
html = `
-`;
+`;
break;
case "phone":
html = `
-`;
+`;
break;
case "checkbox":
html = ``;
@@ -123,7 +123,7 @@ export const genAVValueHTML = (value: IAVCellValue) => {
case "email":
html = `
-`;
+`;
break;
case "relation":
value?.relation?.contents?.forEach((item) => {
@@ -394,7 +394,12 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]
}
};
if (type !== "text") {
- item.parentElement.querySelector("a").setAttribute("href", (type === "url" ? "" : (type === "email" ? "mailto:" : "tel:")) + item.value);
+ const linkElement = item.parentElement.querySelector("a")
+ if (item.value) {
+ linkElement.setAttribute("href", (type === "url" ? "" : (type === "email" ? "mailto:" : "tel:")) + item.value);
+ } else {
+ linkElement.removeAttribute("href");
+ }
}
} else if (type === "number") {
if ("undefined" === item.value || !item.value) {