Skip to content

Commit

Permalink
feat(checks): detect missing space after rst ref
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Jan 16, 2025
1 parent 3834648 commit 20781ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion weblate/checks/markup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions weblate/checks/tests/test_markup_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 20781ae

Please sign in to comment.