def make_element(self, tag, contents='', attrs=None): if attrs: attrs = convert_dictionary_to_html_attributes(attrs) template = '<%(tag)s %(attrs)s>%(contents)s</%(tag)s>' else: template = '<%(tag)s>%(contents)s</%(tag)s>' return template % { 'tag': tag, 'attrs': attrs, 'contents': contents, }
def make_element(self, tag, contents='', attrs=None): if attrs: attrs = convert_dictionary_to_html_attributes(attrs) template = '<{tag} {attrs}>{contents}</{tag}>' else: template = '<{tag}>{contents}</{tag}>' return template.format( tag=tag, attrs=attrs, contents=contents, )
def make_element(self, tag, contents='', attrs=None): if attrs: attrs = convert_dictionary_to_html_attributes(attrs) template = '<{tag} {attrs}>{contents}</{tag}>' else: template = '<{tag}>{contents}</{tag}>' return template.format( tag=tag, attrs=attrs, contents=contents, )
def get_html_attrs(self): return convert_dictionary_to_html_attributes(self.attrs)
def get_html_attrs(self): return convert_dictionary_to_html_attributes(self.attrs)