Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#744): Escape special characters in title #745

Merged
merged 2 commits into from
Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Fixed bug where using an image as a navbar title did not render in GitHub Project pages that did not have a custom domain
- Fixed issue where image thumbnails on the feed page were always forced into a square rather than maintaining a proper image aspect ratio
- Added support for Patreon in the social network links in the footer
- Fixed bug where special characters in the title led to broken share tags (#744)

## v5.0.0 (2020-09-15)

Expand Down
10 changes: 5 additions & 5 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@

{% capture title %}
{%- if page.share-title -%}
{{ page.share-title }}
{{ page.share-title | strip_html | xml_escape }}
{%- elsif page.title -%}
{{ page.title }}
{{ page.title | strip_html | xml_escape }}
{%- else -%}
{{ site.title }}
{{ site.title | strip_html | xml_escape }}
{%- endif -%}
{% endcapture %}

{% capture description %}
{%- if page.share-description -%}
{{ page.share-description }}
{{ page.share-description | strip_html | xml_escape }}
{%- elsif page.subtitle -%}
{{ page.subtitle }}
{{ page.subtitle | strip_html | xml_escape }}
{%- else -%}
{%- assign excerpt_length = site.excerpt_length | default: 50 -%}
{{ page.content | strip_html | xml_escape | truncatewords: excerpt_length | strip }}
Expand Down