Set some class via CSS. Replaces complete class spec.
(self, text)
| 2163 | return child |
| 2164 | |
| 2165 | def add_class(self, text): |
| 2166 | """Set some class via CSS. Replaces complete class spec.""" |
| 2167 | cls = self.get_attribute_value("class") |
| 2168 | if cls is not None and text in cls: |
| 2169 | return self |
| 2170 | self.remove_attribute("class") |
| 2171 | if cls is None: |
| 2172 | cls = text |
| 2173 | else: |
| 2174 | cls += " " + text |
| 2175 | self.set_attribute("class", cls) |
| 2176 | return self |
| 2177 | |
| 2178 | def add_code(self, text=None): |
| 2179 | """Add a "code" tag""" |
no test coverage detected