all repos — py-vite @ 67c11a73b4637fcc3ac805894855190903de255a

the original vite, written in python

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
commit

67c11a73b4637fcc3ac805894855190903de255a

parent

f2cdcd832fb8f65f5e093fc0bd3863e812694788

1 files changed, 10 insertions(+), 0 deletions(-)

jump to
M vite/vite.pyvite/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