+
+
+
diff --git a/frontend/src/utils/utils.ts b/frontend/src/utils/utils.ts
index a323c25..da44cf4 100644
--- a/frontend/src/utils/utils.ts
+++ b/frontend/src/utils/utils.ts
@@ -38,3 +38,18 @@ export function getWeekday(date: Date): number {
if (day == 0) return 6;
else return day - 1;
}
+
+/**
+ * Escape HTML special characters in the string and convert newlines to ` `
+ * so it can be safely inserted via `v-html`. Port of the legacy jQuery-based
+ * `LineBreaker2Br` (`$('
').text(strl).html().replace(/\n/g, ' ')`).
+ * @param strl The raw string to convert.
+ * @returns The escaped, newline-broken HTML string.
+ */
+export function lineBreaker2Br(strl: string): string {
+ return strl
+ .replace(/&/g, '&')
+ .replace(//g, '>')
+ .replace(/\n/g, ' ');
+}
diff --git a/frontend/src/views/Collection.vue b/frontend/src/views/Collection.vue
index 6848f08..be4fe5d 100644
--- a/frontend/src/views/Collection.vue
+++ b/frontend/src/views/Collection.vue
@@ -78,7 +78,7 @@ const addOwnedItem = async () => {
const deleteOwnedItem = async (uuid: string) => {
const rv = await apiCollectionDeleteOwn(token.currentToken, uuid, ownedItems.value.get(uuid)![2]);
- if (rv) {
+ if (!rv) {
messagebox.value?.show("A delete operation failed. It may caused by no matched item. Refreshing page may fix system problem. Before refreshing page, please backup all your unsaved data.");
return;
}
diff --git a/frontend/src/views/Todo.vue b/frontend/src/views/Todo.vue
index fcf17de..eae7379 100644
--- a/frontend/src/views/Todo.vue
+++ b/frontend/src/views/Todo.vue
@@ -1,8 +1,101 @@
-
+
-