Skip to content

Commit

Permalink
Strip tags from page title.
Browse files Browse the repository at this point in the history
There shouldn't be any HTML tags in an HTML `<title>` so there is no harm
in stripping them. And we get the benefit of not having the tags rendered
in the browser's title. See this [comment](Python-Markdown/markdown#1379 (review)).
  • Loading branch information
waylan committed Sep 13, 2023
1 parent cb23b75 commit 3e8fadc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## Version 0.6 (2023/09/13)

* Strip tags from page title.

## Version 0.5 (2023/08/10)

* Add support for a page specific `toc_depth` setting.
Expand Down
2 changes: 1 addition & 1 deletion nature/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ <h3>Quick search</h3>
{%- endblock %}

{%- block htmltitle %}
<title>{% if page and page.title %}{{ page.title }} &#8212; {% endif %}{{ config.site_name }} {{ config.theme.release }} documentation</title>
<title>{% if page and page.title %}{{ page.title|striptags }} &#8212; {% endif %}{{ config.site_name }} {{ config.theme.release }} documentation</title>
{%- endblock %}

{%- block styles %}
Expand Down

0 comments on commit 3e8fadc

Please sign in to comment.