-
-
Save pgtwitter/c2ed5e37fd192db738c60ac22170bc9d to your computer and use it in GitHub Desktop.
Text fragmentsを含むURLの変換 ( https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Fragment/Text_fragments )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %% | |
import urllib.parse as u | |
s = "https://zenn.dev/toropippi/articles/d8def1c994e0a9#:~:text=そんなことを知らず、自作Shaderで sin(time * x) のように書きまくってましたけどね・・ " | |
print(s if ":~:text=" not in s else (x := s.strip().split(":~:text=", 1))[0]+":~:text="+u.quote(x[1])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment