diff --git a/scripts/__pycache__/rtl_ltr_linter.cpython-312.pyc b/scripts/__pycache__/rtl_ltr_linter.cpython-312.pyc new file mode 100644 index 0000000000000..2452784f03e31 Binary files /dev/null and b/scripts/__pycache__/rtl_ltr_linter.cpython-312.pyc differ diff --git a/scripts/rtl_ltr_linter.py b/scripts/rtl_ltr_linter.py index 8c990c9717467..bd8c93427c894 100644 --- a/scripts/rtl_ltr_linter.py +++ b/scripts/rtl_ltr_linter.py @@ -94,8 +94,8 @@ def is_rtl_filename(path): # Example: Book Title - Author (Metadata) BOOK_ITEM_RE = re.compile( r"^\s*\[(?P.+?)\]\((?P<url>.+?)\)" # Title and URL (required) - r"(?:\s*[-–—]\s*(?P<author>[^\(\n\[]+?))?" # Author (optional), separated by -, –, — - r"(?:\s*[\(\[](?P<meta>.*?)[\)\]])?\s*$" # Metadata (optional), enclosed in parentheses () or [] + r"(?:\s*[-–—]\s*(?P<author>.*?))?" # Author (optional), separated by -, –, — + r"(?:\s*[\(\[](?P<meta>[^\]\)]*)[\)\]])?\s*$" # Metadata (optional), enclosed in parentheses () or [] ) # Regex to find the dir="rtl" or dir="ltr" attribute in an HTML tag