def rectify(link:str, parent:str, path:str):
	"""A function to check a link and verify that it should be captured or not.
	For e.g. any external URL would be blocked. It would also take care that all the urls are properly formatted.

	Args:
		**link (str)**: the link to rectify.
		**parent (str)**: the complete url of the page from which the link was found.
		**path (str)**: the path (after the domain) of the page from which the link was found.

	Returns:
		**str**: the properly formatted link.
	"""
	if (link.startswith("#")) or (":" in link) or ("../" in link):
		return path
	if not link.startswith("/"):
		if parent.endswith("/"):
			if not path.endswith("/"):
				path += "/"
			return path + link
		else:
			path = "/".join(path.split("/")[:-1])+"/"
			return path + link

	return link