Skip to content

Commit 852775b

Browse files
committed
Sanitize YAML data
1 parent b82c376 commit 852775b

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

_jekyll/includes/3-modules/link-list.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
- author[.name] string|Author The author's name of the linked content.
99
- author.url string The author's URL of the linked content.
1010
- source string Link to the source code of the link's destination.
11-
11+
1212
Parameters:
1313
title string The title of this list of links.
1414
link Link[] The link objects to display in the list.
1515
class string A CSS class that should be applied to the list's container.
1616
{% endcomment %}
1717

1818

19-
<div class="link-list {{ include.class }}">
20-
<h3>{{ include.title }}</h3>
19+
<div class="link-list {{ include.class | xml_escape }}">
20+
<h3>{{ include.title | xml_escape }}</h3>
2121
<ul>
2222
{% for link in include.links %}
2323
<li>
@@ -36,7 +36,7 @@ <h3>{{ include.title }}</h3>
3636
{% assign url = link.url %}
3737
{% endif %}
3838

39-
39+
4040
{% comment %} Generate link based on its destination (internal or external). {% endcomment %}
4141
{% if url contains 'http://' or url contains 'https://' %}
4242

@@ -49,16 +49,16 @@ <h3>{{ include.title }}</h3>
4949
{% else %}
5050

5151
{% comment %} No link, just show the text. {% endcomment %}
52-
<span class="fake-link">{{ link.title }}</span>
52+
<span class="fake-link">{{ link.title | xml_escape }}</span>
5353
{% endif %}
5454

5555

5656
{% comment %} Link to the destination's author. {% endcomment %}
5757
{% if link.author %}
5858
{% if link.author.url %}
59-
<i>by <a href="{{ link.author.url }}" target="blank">{{ link.author.name }}</a></i>
59+
<i>by <a href="{{ link.author.url }}" target="blank">{{ link.author.name | xml_escape }}</a></i>
6060
{% else %}
61-
<i>by {{ link.author.name | default: link.author }}</i>
61+
<i>by {{ link.author.name | default: link.author | xml_escape }}</i>
6262
{% endif %}
6363
{% endif %}
6464

_jekyll/includes/3-modules/video-card.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</div>
3939

4040
{% comment %} Video title. {% endcomment %}
41-
<h3>{{ include.video.title }}</h3>
41+
<h3>{{ include.video.title | xml_escape }}</h3>
4242

4343
{% comment %} Release date. {% endcomment %}
4444
{% if include.video.date > site.time %}

_jekyll/layouts/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ <h2>Sorry, but this videos hasn't been processed yet</h2>
2424
{% else %}
2525

2626
{% if page.title %}
27-
<h2>{{ page.title }}</h2>
27+
<h2>{{ page.title | xml_escape }}</h2>
2828
{% endif %}
2929

3030
{{ content }}

_jekyll/layouts/series-index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="series-index">
66
{% comment %} Extract the path of this series. {% endcomment %}
77
{% assign thisSeriesPath = page.path | remove: '/index.md' | append: '/' %}
8-
8+
99
{% comment %} Only select videos that are in this series. {% endcomment %}
1010
{% assign videos = site[page.collection] %}
1111
{% include 1-tools/sort-videos.html videos=videos seriesPage=page %}
@@ -30,7 +30,7 @@
3030
{% endif %}
3131
{% endunless %}
3232

33-
{{ page.subtitle }}
33+
{{ page.subtitle | xml_escape }}
3434
</div>
3535

3636
{% comment %} Show the series description. {% endcomment %}
@@ -43,7 +43,7 @@
4343
{% assign seriesIndexPages = videos | where: 'layout', 'series-index'
4444
| where_exp: 'seriesIndex', 'seriesIndex.path != page.path'
4545
| sort: 'series_number' %}
46-
46+
4747
{% comment %} Show the first three videos for every series ... {% endcomment %}
4848
{% for seriesIndexPage in seriesIndexPages %}
4949

0 commit comments

Comments
 (0)