diff options
| author | klm | 1998-04-09 00:01:27 +0000 |
|---|---|---|
| committer | klm | 1998-04-09 00:01:27 +0000 |
| commit | 303f925eba07686cdb90136725213c58c399e6b9 (patch) | |
| tree | 3767c8638dadb0fc506eea72456a60ebbe9974e7 /Mailman/htmlformat.py | |
| parent | e887885d025332998a5d271bb5addfefe8b3b22a (diff) | |
| download | mailman-303f925eba07686cdb90136725213c58c399e6b9.tar.gz mailman-303f925eba07686cdb90136725213c58c399e6b9.tar.zst mailman-303f925eba07686cdb90136725213c58c399e6b9.zip | |
Diffstat (limited to 'Mailman/htmlformat.py')
| -rw-r--r-- | Mailman/htmlformat.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/Mailman/htmlformat.py b/Mailman/htmlformat.py index 698ef04f2..72a6a53b9 100644 --- a/Mailman/htmlformat.py +++ b/Mailman/htmlformat.py @@ -175,14 +175,18 @@ class Table: class Link: - def __init__(self, target, text): - self.target = target + def __init__(self, href, text, target=None): + self.href = href self.text = text + self.target = target def Format(self, indent=0): - return '<a href="%s">%s</a>' % (HTMLFormatObject(self.target, indent), - HTMLFormatObject(self.text, indent)) - + texpr = "" + if self.target != None: + texpr = ' target="%s"' % self.target + return '<a href="%s"%s>%s</a>' % (HTMLFormatObject(self.href, indent), + texpr, + HTMLFormatObject(self.text, indent)) class FontSize: """FontSize is being deprecated - use FontAttr(..., size="...") instead.""" @@ -214,7 +218,6 @@ class FontAttr: return output - class Container: def __init__(self, *items): if not items: @@ -244,11 +247,11 @@ class Document(Container): output = 'Content-type: text/html\n\n' spaces = ' ' * indent output = output + spaces - output = output + '<html>\n' + output = output + '<html>\n<head>\n' if self.title: output = '%s%s<TITLE>%s</TITLE>\n' % (output, spaces, self.title) - output = '%s%s</html>\n%s<body' % (output, spaces, spaces) + output = '%s%s</head>\n%s<body' % (output, spaces, spaces) quals = [] for k, v in kw.items(): quals.append('%s="%s"' % (k, v)) |
