fix relative amp hrefs

This commit is contained in:
Ivan Blinkov 2020-05-08 16:53:26 +03:00 committed by GitHub
parent 68ce8a0d82
commit df5a3418b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,7 @@ def html_to_amp(content):
href, anchor = href.split('#') href, anchor = href.split('#')
else: else:
anchor = None anchor = None
href = f'{href}amp/' href = f'../{href}amp/'
if anchor: if anchor:
href = f'{href}#{anchor}' href = f'{href}#{anchor}'
tag.attrs['href'] = href tag.attrs['href'] = href