diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-23 12:39:27 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-23 12:39:27 +0300 |
commit | 3f5fc6278c6aef3dbb967d721c92b7618f5bd126 (patch) | |
tree | 4e52c6cc3b8ba1da9aac2616b39954ae3fe1fa84 /sphinx/util | |
parent | 929a78c5d0bbcae064f122f9eec2b4536a4a4be4 (diff) |
refactor: Add sphinx.util:isurl()
Diffstat (limited to 'sphinx/util')
-rw-r--r-- | sphinx/util/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index 9349ed0e4..c289f5cf8 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -638,6 +638,14 @@ def encode_uri(uri: str) -> str: return urlunsplit(split) +def isurl(url: str) -> bool: + """Check *url* is URL or not.""" + if url and '://' in url: + return True + else: + return False + + def display_chunk(chunk: Any) -> str: if isinstance(chunk, (list, tuple)): if len(chunk) == 1: |