Skip to content

Commit 7cc87b3

Browse files
committed
fix the improve link on the improve page
1 parent 32e27f6 commit 7cc87b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Doc/tools/templates/customsourcelink.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
const elements = document.querySelectorAll('.improvepage');
66
const pageurl = window.location.href.split('?')[0];
77
elements.forEach(element => {
8-
const url = new URL(element.href);
8+
const url = new URL(element.href.split('?')[0]);
99
url.searchParams.set('pagetitle', title);
1010
url.searchParams.set('pageurl', pageurl);
11+
url.searchParams.set('pagesource', "{{ pagename }}.rst");
1112
element.href = url.toString();
1213
});
1314
});
@@ -16,7 +17,7 @@
1617
<h3>{{ _('This page') }}</h3>
1718
<ul class="this-page-menu">
1819
<li><a href="{{ pathto('bugs') }}">{% trans %}Report a bug{% endtrans %}</a></li>
19-
<li><a class="improvepage" href="{{ pathto('improve-page') }}?pagesource={{ pagename }}.rst">{% trans %}Improve this page{% endtrans %}</a></li>
20+
<li><a class="improvepage" href="{{ pathto('improve-page') }}">{% trans %}Improve this page{% endtrans %}</a></li>
2021
<li>
2122
<a href="https://github.com/python/cpython/blob/main/Doc/{{ pagename }}.rst?plain=1"
2223
rel="nofollow">{{ _('Show source') }}

0 commit comments

Comments
 (0)