Skip to content

Commit b915b41

Browse files
committed
fix(markdown_to_bbcode): update regex for repository name extraction
function get_repo_name(): ~modified regex pattern to allow optional '.git' suffix
1 parent ebceb97 commit b915b41

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

markdown_to_bbcode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def get_repo_name():
279279
"""
280280
try:
281281
repo_url = subprocess.check_output(['git', 'config', '--get', 'remote.origin.url'], encoding='utf-8').strip()
282-
pattern = re.compile(r"([^/:]+)/([^/]+)\.git$")
282+
pattern = re.compile(r"([^/:]+)/([^/]+?)(?:\.git)?$")
283283
match = pattern.search(repo_url)
284284
if match:
285285
return f"{match.group(1)}/{match.group(2)}"

0 commit comments

Comments
 (0)