All pastes #433049 Raw Edit

Someone

public text v1 · immutable
·published 2007-04-10 16:04 UTC
rendered paste body
from cStringIO import StringIO

def HTMLmarkup(tag, text, **attributes):
    """
    markups the text with the tag and
    attributes
    """

    s = StringIO()
    s.write('<%s' % tag)
    for attribute, value in attributes.items():
        s.write(' %s="%s"' % (attribute, value))

    s.write('>%s</%s>' % (text, tag))
    return s.getvalue()

def bold(text):
    return HTMLmarkup('b', text)