From 2c12fbfd09d1bb501926dae8d1bd49a6cd0adb66 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 6 Dec 2023 11:18:05 +0100 Subject: [PATCH] fix(front): anonymous participant text is plain text, avoid using v-html It was using v-html when opening to "view more" Signed-off-by: Thomas Citharel --- src/filters/index.ts | 2 -- src/filters/utils.ts | 9 --------- src/utils/html.ts | 4 ---- src/views/Event/ParticipantsView.vue | 12 ++++++------ 4 files changed, 6 insertions(+), 21 deletions(-) delete mode 100644 src/filters/utils.ts diff --git a/src/filters/index.ts b/src/filters/index.ts index 941d69c7..8d02384b 100644 --- a/src/filters/index.ts +++ b/src/filters/index.ts @@ -1,4 +1,3 @@ -import nl2br from "@/filters/utils"; import { formatDateString, formatTimeString, @@ -11,6 +10,5 @@ export default { vue.filter("formatDateString", formatDateString); vue.filter("formatTimeString", formatTimeString); vue.filter("formatDateTimeString", formatDateTimeString); - vue.filter("nl2br", nl2br); }, }; diff --git a/src/filters/utils.ts b/src/filters/utils.ts deleted file mode 100644 index 58e91df6..00000000 --- a/src/filters/utils.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * New Line to
- * - * @param {string} str Input text - * @return {string} Filtered text - */ -export default function nl2br(str: string): string { - return `${str}`.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, "$1
"); -} diff --git a/src/utils/html.ts b/src/utils/html.ts index 084970f7..02b8763b 100644 --- a/src/utils/html.ts +++ b/src/utils/html.ts @@ -1,7 +1,3 @@ -export function nl2br(text: string): string { - return text.replace(/(?:\r\n|\r|\n)/g, "
"); -} - export const getValueFromMeta = (name: string): string | null => { const element = document.querySelector(`meta[name="${name}"]`); if (element && element.getAttribute("content")) { diff --git a/src/views/Event/ParticipantsView.vue b/src/views/Event/ParticipantsView.vue index 7624f920..e5f33aee 100644 --- a/src/views/Event/ParticipantsView.vue +++ b/src/views/Event/ParticipantsView.vue @@ -189,16 +189,15 @@

{{ props.row.metadata.message }}

- +

{{ t("No message") }} @@ -212,7 +211,9 @@