Escape a few links

This commit is contained in:
Matthias Geier 2020-04-06 21:40:36 +02:00
parent 9dec86e98d
commit 99da3fa716
7 changed files with 14 additions and 14 deletions

View File

@ -15,7 +15,7 @@
<div class="header"> <div class="header">
{%- if logo %} {%- if logo %}
<p class="logo"><a href="{{ pathto(master_doc)|e }}"> <p class="logo"><a href="{{ pathto(master_doc)|e }}">
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> <img class="logo" src="{{ pathto('_static/' + logo, 1)|e }}" alt="Logo"/>
</a></p> </a></p>
{%- endif %} {%- endif %}
{%- block headertitle %} {%- block headertitle %}
@ -24,7 +24,7 @@
{%- endblock %} {%- endblock %}
<div class="rel" role="navigation" aria-label="related navigation"> <div class="rel" role="navigation" aria-label="related navigation">
{%- for rellink in rellinks|reverse %} {%- for rellink in rellinks|reverse %}
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" <a href="{{ pathto(rellink[0])|e }}" title="{{ rellink[1]|striptags|e }}"
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
{%- if not loop.last %}{{ reldelim2 }}{% endif %} {%- if not loop.last %}{{ reldelim2 }}{% endif %}
{%- endfor %} {%- endfor %}
@ -78,7 +78,7 @@
<div class="left"> <div class="left">
<div role="navigation" aria-label="related navigaton"> <div role="navigation" aria-label="related navigaton">
{%- for rellink in rellinks|reverse %} {%- for rellink in rellinks|reverse %}
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" <a href="{{ pathto(rellink[0])|e }}" title="{{ rellink[1]|striptags|e }}"
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
{%- if not loop.last %}{{ reldelim2 }}{% endif %} {%- if not loop.last %}{{ reldelim2 }}{% endif %}
{%- endfor %} {%- endfor %}

View File

@ -43,7 +43,7 @@
id="toggle-{{ groupid.next() }}" style="display: none" alt="-" /> id="toggle-{{ groupid.next() }}" style="display: none" alt="-" />
{%- endif %}</td> {%- endif %}</td>
<td>{% if grouptype == 2 %}&#160;&#160;&#160;{% endif %} <td>{% if grouptype == 2 %}&#160;&#160;&#160;{% endif %}
{% if page %}<a href="{{ pathto(page) }}#{{ anchor }}">{% endif -%} {% if page %}<a href="{{ pathto(page)|e }}#{{ anchor }}">{% endif -%}
<code class="xref">{{ name|e }}</code> <code class="xref">{{ name|e }}</code>
{%- if page %}</a>{% endif %} {%- if page %}</a>{% endif %}
{%- if extra %} <em>({{ extra|e }})</em>{% endif -%} {%- if extra %} <em>({{ extra|e }})</em>{% endif -%}

View File

@ -32,7 +32,7 @@
<ul> <ul>
{%- for rellink in rellinks %} {%- for rellink in rellinks %}
<li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}> <li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}>
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" <a href="{{ pathto(rellink[0])|e }}" title="{{ rellink[1]|striptags|e }}"
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
{%- if not loop.first %}{{ reldelim2 }}{% endif %}</li> {%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
{%- endfor %} {%- endfor %}
@ -54,7 +54,7 @@
{%- block sidebarlogo %} {%- block sidebarlogo %}
{%- if logo %} {%- if logo %}
<p class="logo"><a href="{{ pathto(master_doc)|e }}"> <p class="logo"><a href="{{ pathto(master_doc)|e }}">
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> <img class="logo" src="{{ pathto('_static/' + logo, 1)|e }}" alt="Logo"/>
</a></p> </a></p>
{%- endif %} {%- endif %}
{%- endblock %} {%- endblock %}
@ -94,13 +94,13 @@
{%- endmacro %} {%- endmacro %}
{%- macro css() %} {%- macro css() %}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /> <link rel="stylesheet" href="{{ pathto('_static/' + style, 1)|e }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- for css in css_files %} {%- for css in css_files %}
{%- if css|attr("filename") %} {%- if css|attr("filename") %}
{{ css_tag(css) }} {{ css_tag(css) }}
{%- else %} {%- else %}
<link rel="stylesheet" href="{{ pathto(css, 1) }}" type="text/css" /> <link rel="stylesheet" href="{{ pathto(css, 1)|e }}" type="text/css" />
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{%- endmacro %} {%- endmacro %}
@ -139,7 +139,7 @@
href="{{ pathto('_static/opensearch.xml', 1) }}"/> href="{{ pathto('_static/opensearch.xml', 1) }}"/>
{%- endif %} {%- endif %}
{%- if favicon %} {%- if favicon %}
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/> <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1)|e }}"/>
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
{%- block linktags %} {%- block linktags %}

View File

@ -7,7 +7,7 @@
template="{{ use_opensearch }}/{{ pathto('search') }}?q={searchTerms}"/> template="{{ use_opensearch }}/{{ pathto('search') }}?q={searchTerms}"/>
<LongName>{{ docstitle|e }}</LongName> <LongName>{{ docstitle|e }}</LongName>
{%- if favicon %} {%- if favicon %}
<Image height="16" width="16" type="image/x-icon">{{ use_opensearch }}/{{ pathto('_static/' + favicon, 1) }}</Image> <Image height="16" width="16" type="image/x-icon">{{ use_opensearch }}/{{ pathto('_static/' + favicon, 1)|e }}</Image>
{%- endif %} {%- endif %}
{% block extra %} {# Put e.g. an <Image> element here. #} {% endblock %} {% block extra %} {# Put e.g. an <Image> element here. #} {% endblock %}
</OpenSearchDescription> </OpenSearchDescription>

View File

@ -36,11 +36,11 @@
{%- block haikuheader %} {%- block haikuheader %}
{%- if theme_full_logo != "false" %} {%- if theme_full_logo != "false" %}
<a href="{{ pathto('index') }}"> <a href="{{ pathto('index') }}">
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> <img class="logo" src="{{ pathto('_static/' + logo, 1)|e }}" alt="Logo"/>
</a> </a>
{%- else %} {%- else %}
{%- if logo -%} {%- if logo -%}
<img class="rightlogo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> <img class="rightlogo" src="{{ pathto('_static/' + logo, 1)|e }}" alt="Logo"/>
{%- endif -%} {%- endif -%}
<h1 class="heading"><a href="{{ pathto('index') }}"> <h1 class="heading"><a href="{{ pathto('index') }}">
<span>{{ shorttitle|e }}</span></a></h1> <span>{{ shorttitle|e }}</span></a></h1>

View File

@ -13,7 +13,7 @@
<div class="header" role="banner"> <div class="header" role="banner">
<div class="logo"> <div class="logo">
<a href="{{ pathto(master_doc)|e }}"> <a href="{{ pathto(master_doc)|e }}">
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> <img class="logo" src="{{ pathto('_static/' + logo, 1)|e }}" alt="Logo"/>
</a> </a>
</div> </div>
</div> </div>

View File

@ -30,7 +30,7 @@
{%- if prev %} {%- if prev %}
<a href="{{ prev.link|e }}">&laquo; {{ prev.title }}</a> | <a href="{{ prev.link|e }}">&laquo; {{ prev.title }}</a> |
{%- endif %} {%- endif %}
<a href="{{ pathto(current_page_name) if current_page_name else '#' }}">{{ title }}</a> <a href="{{ pathto(current_page_name)|e if current_page_name else '#' }}">{{ title }}</a>
{%- if next %} {%- if next %}
| <a href="{{ next.link|e }}">{{ next.title }} &raquo;</a> | <a href="{{ next.link|e }}">{{ next.title }} &raquo;</a>
{%- endif %} {%- endif %}