Skip to content

Commit

Permalink
Use proper HTML escaping for GitHub discussions link
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-opp committed Jan 23, 2022
1 parent 6b241de commit c7eced8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions blog/templates/snippets.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

<p class="comment-note">
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 <a href="https://www.rust-lang.org/policies/code-of-conduct">code of conduct</a>. This comment thread directly maps to a <a href="{{ discussion_url }}"><em>discussion on GitHub</em></a>, 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 <a href="https://www.rust-lang.org/policies/code-of-conduct">code of conduct</a>. This comment thread directly maps to a <a href="{{ discussion_url | safe }}"><em>discussion on GitHub</em></a>, so you can also comment there if you prefer.
</p>

<div class="giscus"></div>
Expand All @@ -42,6 +43,6 @@
</script>

<p class="comment-directly-on-github">
Instead of authenticating the <a href="https://giscus.app">giscus</a> application, you can also comment directly <a href="{{ discussion_url }}"><em>on GitHub</em></a>.
Instead of authenticating the <a href="https://giscus.app">giscus</a> application, you can also comment directly <a href="{{ discussion_url | safe }}"><em>on GitHub</em></a>.
</p>
{% endmacro giscus %}

0 comments on commit c7eced8

Please sign in to comment.