diff --git a/docs/conf.py b/docs/conf.py index 9fe9d985..99fe52aa 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,3 +1,5 @@ +import packaging + from pallets_sphinx_themes import get_version from pallets_sphinx_themes import ProjectLink @@ -74,7 +76,7 @@ def github_link(name, rawtext, text, lineno, inliner, options=None, content=None else: words = None - if release.endswith("dev"): + if packaging.version.parse(release).is_devrelease: url = "{0}master/{1}".format(base_url, text) else: url = "{0}{1}/{2}".format(base_url, release, text) diff --git a/docs/patterns/urlprocessors.rst b/docs/patterns/urlprocessors.rst index 3f65d758..0d743205 100644 --- a/docs/patterns/urlprocessors.rst +++ b/docs/patterns/urlprocessors.rst @@ -39,8 +39,8 @@ generate URLs from one function to another you would have to still provide the language code explicitly which can be annoying. For the latter, this is where :func:`~flask.Flask.url_defaults` functions -come in. They can automatically inject values into a call for -:func:`~flask.url_for` automatically. The code below checks if the +come in. They can automatically inject values into a call to +:func:`~flask.url_for`. The code below checks if the language code is not yet in the dictionary of URL values and if the endpoint wants a value named ``'lang_code'``::