MCPcopy Index your code
hub / github.com/aws/aws-cli / _end_inline

Method _end_inline

awscli/bcdoc/style.py:82–99  ·  view source on GitHub ↗
(self, markup)

Source from the content-addressed store, hash-verified

80 self.doc.write(markup)
81
82 def _end_inline(self, markup):
83 # Sometimes the HTML markup has whitespace between the end
84 # of the text inside the inline markup and the closing element
85 # (e.g. <b>foobar </b>). This trailing space will cause
86 # problems in the ReST inline markup so we remove it here
87 # by popping the last item written off the stack, striping
88 # the whitespace and then pushing it back on the stack.
89 last_write = self.doc.pop_write().rstrip(' ')
90
91 # Sometimes, for whatever reason, a tag like <b/> is present. This
92 # is problematic because if we simply translate that directly then
93 # we end up with something like ****, which rst will assume is a
94 # heading instead of an empty bold.
95 if last_write == markup:
96 return
97
98 self.doc.push_write(last_write)
99 self.doc.write(markup + ' ')
100
101 def start_bold(self, attrs=None):
102 self._start_inline('**')

Callers 3

end_boldMethod · 0.95
end_italicsMethod · 0.95
end_codeMethod · 0.95

Calls 3

pop_writeMethod · 0.45
push_writeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected