diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-03-11 15:37:13 +0900 |
---|---|---|
committer | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-04-09 14:59:46 +0900 |
commit | 2ba51577aef4f4a808e292f2bfa9fd8e36e5c64f (patch) | |
tree | 0149527215b898d59d13754770fa21dee91f41af /scripts | |
parent | 7fffe236b78e6b7112c96e76755b5f8901b71f47 (diff) |
html: add http link for task comment
If comment had http[s] links, this patch add <a> link for it.
It doesn't work correctly somehow if <a target="subbody">,
so, it uses <a target="_blank"> so far.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/html.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/html.py b/scripts/html.py index d9b181d..26f6804 100755 --- a/scripts/html.py +++ b/scripts/html.py @@ -7,6 +7,7 @@ #=============================== import sys import os +import re import base import find @@ -500,6 +501,12 @@ class periject_html(base.base): with html("ul"): for comment in comments: + str = re.search(r'(https?://[\w/:%#\$&\?\(\)~\.=\+\-]+)', comment) + if (str): + a = html("a", {"href":str.group(), + "target":"_blank"}) + comment = str.string[:str.start()] + a.text(str.group()) + str.string[str.end():] + html("li").print(comment) #-------------------- |