From c7eced8b49f132cac16e06f7e79bb82ccd30de5f Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 23 Jan 2022 17:53:12 +0100 Subject: [PATCH] Use proper HTML escaping for GitHub discussions link --- blog/templates/snippets.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/blog/templates/snippets.html b/blog/templates/snippets.html index 4680e079..9065977e 100644 --- a/blog/templates/snippets.html +++ b/blog/templates/snippets.html @@ -14,11 +14,12 @@ {% if search_term is number %} {% set discussion_url = "https://github.com/phil-opp/blog_os/discussions/" ~ search_term %} {% else %} - {% set discussion_url = `https://github.com/phil-opp/blog_os/discussions/categories/post-comments?discussions_q=%22` ~ search_term ~ `%22` %} + {% set search_term_encoded = `"` ~ search_term ~ `"` | urlencode %} + {% set discussion_url = `https://github.com/phil-opp/blog_os/discussions/categories/post-comments?discussions_q=` ~ search_term_encoded %} {% endif %}

- Do you have a problem, want to share feedback, or discuss further ideas? Feel free to leave a comment here! Please stick to English and follow Rust's code of conduct. This comment thread directly maps to a discussion on GitHub, so you can also comment there if you prefer. + Do you have a problem, want to share feedback, or discuss further ideas? Feel free to leave a comment here! Please stick to English and follow Rust's code of conduct. This comment thread directly maps to a discussion on GitHub, so you can also comment there if you prefer.

@@ -42,6 +43,6 @@

- Instead of authenticating the giscus application, you can also comment directly on GitHub. + Instead of authenticating the giscus application, you can also comment directly on GitHub.

{% endmacro giscus %}