in src/co_op_translator/utils/llm/markdown_utils.py [0:0]
def count_links_in_markdown(content: str) -> int:
"""
Count the number of links in a markdown document.
Args:
content (str): The markdown content.
Returns:
int: The number of links in the content.
"""
link_pattern = re.compile(r"\[.*?\]\(.*?\)")
return len(link_pattern.findall(content))