aboutsummaryrefslogtreecommitdiff
path: root/textoutpc/builtin/_Link.py
diff options
context:
space:
mode:
Diffstat (limited to 'textoutpc/builtin/_Link.py')
-rwxr-xr-xtextoutpc/builtin/_Link.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/textoutpc/builtin/_Link.py b/textoutpc/builtin/_Link.py
index efe4a5a..b4b7ed9 100755
--- a/textoutpc/builtin/_Link.py
+++ b/textoutpc/builtin/_Link.py
@@ -52,7 +52,12 @@ class LinkTag(_InlineTag):
self._validate()
def begin_html(self):
- return '<a href="{}">'.format(_htmlescape(self._url))
+ target = self.tweak("link_target", "").casefold()
+ tattrs = ''
+ if target == 'blank':
+ tattrs = ' target="_blank" rel="noopener"'
+
+ return '<a href="{}"{}>'.format(_htmlescape(self._url), tattrs)
def end_html(self):
return '</a>'