diff --git a/CHANGELOG.md b/CHANGELOG.md index fbdc6f5..c331819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## Unreleased + +### Fixed + +- `:prog_name:` and other options can now contain multiple words (it used to stop at whitespace). (Pull #60) + ## 0.8.0 - 2022-06-19 ### Added diff --git a/mkdocs_click/_processing.py b/mkdocs_click/_processing.py index a816eb7..762e831 100644 --- a/mkdocs_click/_processing.py +++ b/mkdocs_click/_processing.py @@ -22,7 +22,7 @@ def replace_blocks(lines: Iterable[str], title: str, replace: Callable[..., Iter for line in lines: if in_block_section: - match = re.search(r"^\s+:(?P.+):(?:\s+(?P\S+))?", line) + match = re.search(r"^\s+:(?P.+):(?:\s+(?P.*\S))?", line) if match is not None: # New ':key:' or ':key: value' line, ingest it. key = match.group("key") diff --git a/tests/test_processing.py b/tests/test_processing.py index b78b052..45dc651 100644 --- a/tests/test_processing.py +++ b/tests/test_processing.py @@ -12,16 +12,17 @@ def test_replace_options(): foo ::: target :option1: value1 - :optiøn2: value2 + :optiøn2: val ue2 \t:option3: :option4:\x20 + :option5: 1 bar """.strip() expected = """ # Some content foo -{'option1': 'value1', 'optiøn2': 'value2', 'option3': '', 'option4': ''} +{'option1': 'value1', 'optiøn2': 'val ue2', 'option3': '', 'option4': '', 'option5': '1'} bar """.strip()