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

Method htmlNode

Lib/pagebot/base/typesetter.py:571–585  ·  view source on GitHub ↗

Open the tag in HTML output and copy the node attributes if there are any.

(self, node, end=False)

Source from the content-addressed store, hash-verified

569 self.TEXTBOX_CLASS(bs, parent=self.galley)
570
571 def htmlNode(self, node, end=False):
572 """Open the tag in HTML output and copy the node attributes if there are any."""
573 htmlTag = u'<%s' % node.tag
574 attrs = []
575 for name, value in node.items():
576 if name == 'src' and value.startswith('docs/'):
577 # Exception hack to bridge the .md --> img URL.
578 value = value[5:]
579 attrs.append('%s="%s"' % (name, value))
580 if attrs:
581 htmlTag += u' '+u' '.join(attrs)
582 if end:
583 htmlTag += '/'
584 htmlTag += '>'
585 self.append(htmlTag)
586
587 def _htmlNode(self, node):
588 """Close the html tag of node."""

Callers 2

htmlNode_Method · 0.95
typesetNodeMethod · 0.95

Calls 1

appendMethod · 0.95

Tested by

no test coverage detected