aio-libs / aio-libs/yarl

There should be a way to add a empty fragment with URL.with_fragment()

Ouverte
#147 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
1.5k
Forks
215
Merge moyen
1 j 2 min
PR mergées (30 j)
13

Description

[According to the HTML5 spec (6.7.9)](https://www.w3.org/TR/html5/single-page.html#navigating-to-a-fragment-identifier) the empty fragment `#` and the special fragment `#top` links to the top of the page.

I would like to be able to create an URL with an empty fragment using the `URL.with_fragment()` method.

Currently both `URL.with_fragment(None)` and `URL.with_fragment("")` _removes_ the fragment from the URL.

I suggest that with an empty string parameter it should create an empty fragment `#`.

Thanks for aiohttp and this great library!

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.