Skip to content

Commit 5837247

Browse files
authored
Merge pull request readthedocs#5369 from stsewd/more-protection-in-anchors
Protect against anchors with #
2 parents 439e8af + 978ea27 commit 5837247

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

readthedocs/projects/tasks.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,11 @@ def warn(self, msg):
12801280
# ('Sphinx', '1.7.9', 'faq.html#epub-faq', 'Epub info')
12811281
url = einfo[2]
12821282
if '#' in url:
1283-
doc_name, anchor = url.split('#')
1283+
doc_name, anchor = url.split(
1284+
'#',
1285+
# The anchor can contain ``#`` characters
1286+
maxsplit=1
1287+
)
12841288
else:
12851289
doc_name, anchor = url, ''
12861290
display_name = einfo[3]

0 commit comments

Comments
 (0)