diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2022-03-27 19:47:11 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2022-03-27 19:47:11 +0900 |
commit | 2db180da70cfd59ae53afab99d1eb7868fb7d206 (patch) | |
tree | 4792f14a6e05cd42a1750988949db6cbef17bdbe /sphinx/ext/extlinks.py | |
parent | a457819971f9b32fd57726b1e75f4caa6eaf17ab (diff) | |
parent | f559389d14d32b1cc70792a5bbbbdfb963e0ce6a (diff) | |
download | sphinx-git-2db180da70cfd59ae53afab99d1eb7868fb7d206.tar.gz |
Merge branch '4.x'
Diffstat (limited to 'sphinx/ext/extlinks.py')
-rw-r--r-- | sphinx/ext/extlinks.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sphinx/ext/extlinks.py b/sphinx/ext/extlinks.py index 97c4cfe87..3ff8bdb5b 100644 --- a/sphinx/ext/extlinks.py +++ b/sphinx/ext/extlinks.py @@ -45,6 +45,9 @@ class ExternalLinksChecker(SphinxPostTransform): default_priority = 500 def run(self, **kwargs: Any) -> None: + if not self.config.extlinks_detect_hardcoded_links: + return + for refnode in self.document.findall(nodes.reference): self.check_uri(refnode) @@ -119,6 +122,8 @@ def setup_link_roles(app: Sphinx) -> None: def setup(app: Sphinx) -> Dict[str, Any]: app.add_config_value('extlinks', {}, 'env') + app.add_config_value('extlinks_detect_hardcoded_links', False, 'env') + app.connect('builder-inited', setup_link_roles) app.add_post_transform(ExternalLinksChecker) return {'version': sphinx.__display_version__, 'parallel_read_safe': True} |