better auto-link
This commit is contained in:
@@ -11,11 +11,11 @@ RE_EM = re.compile(r"\*(.*?)\*")
|
|||||||
RE_LIST = re.compile(r"(-|[0-9]\.) .*")
|
RE_LIST = re.compile(r"(-|[0-9]\.) .*")
|
||||||
|
|
||||||
RE_PLAINURL = re.compile(
|
RE_PLAINURL = re.compile(
|
||||||
r"([ |\n])(https?://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-]))[^\)]"
|
r"(?P<pre>^|\s|\n)(?P<url>https?://([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-]))(?P<post>\s|\n|$)"
|
||||||
)
|
)
|
||||||
|
|
||||||
def html(text):
|
def html(text):
|
||||||
text = RE_PLAINURL.sub(r'\1[\2](\2)', text)
|
text = RE_PLAINURL.sub(r'\g<pre>[\g<url>](\g<url>)\g<post>', text)
|
||||||
return markdown2.markdown(text)
|
return markdown2.markdown(text)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
docker-compose up -d -t 0 --build forum
|
docker-compose up -d -t 0 --build --force-recreate forum
|
||||||
docker-compose logs -f
|
docker-compose logs -f
|
||||||
|
|||||||
Reference in New Issue
Block a user