Add link-patterns extra, regex for links as links Signed-off-by: Anirudh Oppiliappan <x@icyphox.sh>
Anirudh Oppiliappan x@icyphox.sh
Tue, 05 Nov 2019 12:45:26 +0530
1 files changed,
10 insertions(+),
0 deletions(-)
jump to
M
vite/vite.py
→
vite/vite.py
@@ -11,6 +11,7 @@ import http.server
import socketserver import shutil import datetime +import re from markdown2 import markdown_path from huepy import *@@ -156,6 +157,15 @@ "header-ids",
"footnotes", "smarty-pants", "tables", + "link-patterns", + ], + link_patterns=[ + ( + re.compile( + r"((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+(:[0-9]+)?|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)" + ), + r"\1", + ) ], ) return html