MCPcopy Create free account
hub / github.com/PageBot/PageBot / write_tag

Method write_tag

Lib/pagebot/contexts/htmlcontext/xmlbuilder.py:155–170  ·  view source on GitHub ↗

Writes a normally formatted HTML tag, exceptions have a custom implementation, see respective functions.

(self, tagname, isOpen, args)

Source from the content-addressed store, hash-verified

153 self.write(value)
154
155 def write_tag(self, tagname, isOpen, args):
156 """Writes a normally formatted HTML tag, exceptions have a custom
157 implementation, see respective functions.
158 """
159 self.tabs()
160 self.write(u'<' + tagname)
161 self.getandwrite_attributes(tagname, args)
162
163 if isOpen:
164 self.write(u'>')
165 # Push as last, so we can see the current tag on the stack
166 self._pushTag(tagname)
167 self.tabIn()
168 else:
169 self.write(u'/>')
170 self.newLine() # Optional write newline if not self.compat
171
172 def write_tag_noWhitespace(self, tagname, isOpen, args):
173 """Writes a normally formatted HTML tag, exceptions have a custom

Callers 15

titleMethod · 0.80
linkMethod · 0.80
bodyMethod · 0.80
figureMethod · 0.80
figcaptionMethod · 0.80
hgroupMethod · 0.80
articleMethod · 0.80
headerMethod · 0.80
footerMethod · 0.80
sectionMethod · 0.80
blockquoteMethod · 0.80
citeMethod · 0.80

Calls 6

tabsMethod · 0.95
_pushTagMethod · 0.95
tabInMethod · 0.95
newLineMethod · 0.95
writeMethod · 0.80

Tested by

no test coverage detected