{link["description"]}
' body += f'\n ' body += '\n' body += f'{created}' body += f'{updated}
' if "notes" in link.keys(): blocks = map(lambda x: x.strip(), link["notes"].split("\n")) blocks = list(filter(None, blocks)) for i, block in enumerate(blocks): block = re.sub(r'\*\*\*(.+)\*\*\*', r'\1', block) block = re.sub(r'\*\*(.+)\*\*', r'\1', block) block = re.sub(r'\*(.+)\*', r'\1', block) block = re.sub(r'\[(.+)\]\((.+)\)', r'\1', block) header = r'(#+)\s*(.+)' if re.match(header, block): groups = re.match(header, block).groups() tag = "h" + str(len(groups[0])) blocks[i] = f"<{tag}>{groups[1]}{tag}>" else: blocks[i] = f"{block}
" body += '\n