From 1a1497e298d1a2a5c859cc0cf0887cdd3ee8791c Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Thu, 22 Dec 2022 12:03:08 +0000 Subject: [PATCH] fix history links (#4866) --- docs/build/main.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/build/main.py b/docs/build/main.py index f55237867d..296d1e24b0 100755 --- a/docs/build/main.py +++ b/docs/build/main.py @@ -10,7 +10,7 @@ def main() -> int: history = (PROJECT_ROOT / 'HISTORY.md').read_text() - history = re.sub(r'#(\d+)', r'[#\1](https://github.com/pydantic/pydantic/issues/\1)', history) + history = re.sub(r'(\s)#(\d+)', r'\1[#\2](https://github.com/pydantic/pydantic/issues/\2)', history) history = re.sub(r'(\s)@([\w\-]+)', r'\1[@\2](https://github.com/\2)', history, flags=re.I) history = re.sub('@@', '@', history) diff --git a/setup.py b/setup.py index 81cf6d545b..609cd1bbe1 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ def extra(self): THIS_DIR = Path(__file__).resolve().parent try: history = (THIS_DIR / 'HISTORY.md').read_text(encoding='utf-8') - history = re.sub(r'#(\d+)', r'[#\1](https://github.com/pydantic/pydantic/issues/\1)', history) + history = re.sub(r'(\s)#(\d+)', r'\1[#\2](https://github.com/pydantic/pydantic/issues/\2)', history) history = re.sub(r'( +)@([\w\-]+)', r'\1[@\2](https://github.com/\2)', history, flags=re.I) history = re.sub('@@', '@', history)