diff --git a/weblate/checks/markup.py b/weblate/checks/markup.py index 8975bb835397..5b1ada071794 100644 --- a/weblate/checks/markup.py +++ b/weblate/checks/markup.py @@ -64,7 +64,7 @@ ) RST_REF_MATCH = re.compile( - r"(?:(?<=\s)|^)((:[a-z:]+:)(?:`([^<`]+)`|`[^<`]+<([^<` ]+)>`))" + r"(?:(?<=\W)|^)((:[a-z:]+:)(?:`([^<`]+)`|`[^<`]+<([^<` ]+)>`))(?=\W|$)" ) # These should be present in translation if present in source, but might be translated diff --git a/weblate/checks/tests/test_markup_checks.py b/weblate/checks/tests/test_markup_checks.py index e1d78c594257..fbb985d4066d 100644 --- a/weblate/checks/tests/test_markup_checks.py +++ b/weblate/checks/tests/test_markup_checks.py @@ -458,6 +458,14 @@ def test_ref_space(self) -> None: "rst-text", ), ) + self.do_test( + True, + ( + ":ref:`Searching` now supports", + ":ref:`Searching`agora suporta", + "rst-text", + ), + ) def test_translatable(self) -> None: self.do_test(