Fix mapping of ref targets with underscores

This commit is contained in:
Kovid Goyal 2022-08-19 14:34:25 +05:30
parent aba634ce88
commit 0b66f20934
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -26,7 +26,7 @@ def main() -> Dict[str, str]:
href = os.path.relpath(stream.name, base).replace(os.sep, '/') href = os.path.relpath(stream.name, base).replace(os.sep, '/')
href = href.rpartition('.')[0] + '/' href = href.rpartition('.')[0] + '/'
for explicit_target in find_explicit_targets(raw): for explicit_target in find_explicit_targets(raw):
refs[explicit_target] = href + f'#{explicit_target}' refs[explicit_target] = href + f'#{explicit_target.replace("_", "-")}'
return {'ref': refs} return {'ref': refs}