Skip to content

Commit

Permalink
Change: Create a markdown link only if an url is passed to linker func
Browse files Browse the repository at this point in the history
Allow to call the linker function without an url to not create a
markdown link in that case.
  • Loading branch information
bjoernricks committed Jul 18, 2023
1 parent ce4b5a7 commit da0b7e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mattermost_notify/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def __str__(self):
DEFAULT_GIT = "https://github.com"


def _linker(name: str, url: str) -> str:
def _linker(name: str, url: Optional[str] = None) -> str:
# create a markdown link
return f"[{name}]({url})"
return f"[{name}]({url})" if url else name


def get_github_event_json(term: ConsoleTerminal) -> dict[str, Any]:
Expand Down

0 comments on commit da0b7e0

Please sign in to comment.