From 8e83d4d0a4486ac12afd0be2a64680b2ecba8f36 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 29 Sep 2022 11:03:58 +0200 Subject: [PATCH] option ref: support optional part with '[=value]' or ' value' This supports a commonly used format when it comes to optional argument: -fauto-profile[=path], where `path` is optional part. Plus it supports a format when space is used: -fauto-profile path. Extends: #10840 Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- tests/roots/test-root/objects.txt | 3 ++- tests/test_build_html.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/roots/test-root/objects.txt b/tests/roots/test-root/objects.txt index 36c8dd051d5..170c026e760 100644 --- a/tests/roots/test-root/objects.txt +++ b/tests/roots/test-root/objects.txt @@ -214,7 +214,8 @@ Test repeated option directive. My secret API. -Reference the first option :option:`-mapi=secret` or :option:`-mapi[=xxx]`. +Reference the first option :option:`-mapi=secret`, :option:`-mapi[=xxx]` +or :option:`-mapi with_space`. User markup diff --git a/tests/test_build_html.py b/tests/test_build_html.py index 15c488be482..138f8a9c129 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -1773,6 +1773,7 @@ def test_option_reference_with_value(app, status, warning): assert 'first option ' in content assert ('' '-mapi[=xxx]') in content + assert '-mapi with_space' in content @pytest.mark.sphinx('html', testroot='theming')