From c85e61dafc1927e4a947f0ee19c570d28e75e628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Srokosz?= Date: Mon, 31 Jul 2023 13:48:12 +0200 Subject: [PATCH] Fix: Search links rendered rich attributes break when value contains space --- mwdb/web/src/commons/helpers/renderTokens.tsx | 5 ++++- mwdb/web/src/components/RichAttribute/MarkedMustache.tsx | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mwdb/web/src/commons/helpers/renderTokens.tsx b/mwdb/web/src/commons/helpers/renderTokens.tsx index df01c124f..199e4a526 100644 --- a/mwdb/web/src/commons/helpers/renderTokens.tsx +++ b/mwdb/web/src/commons/helpers/renderTokens.tsx @@ -92,7 +92,10 @@ export function renderTokens(tokens: Token[], options?: Option): any { if (token.href && token.href.startsWith("search#")) { const query = token.href.slice("search#".length); const search = - "?" + new URLSearchParams({ q: query }).toString(); + "?" + + new URLSearchParams({ + q: decodeURIComponent(query), + }).toString(); return (