Add header tag
(self, level=1)
| 2205 | return child |
| 2206 | |
| 2207 | def add_header(self, level=1): |
| 2208 | """Add header tag""" |
| 2209 | if level not in range(1, 7): |
| 2210 | raise ValueError("Header level must be in [1, 6]") |
| 2211 | this_tag = self.tagname |
| 2212 | new_tag = f"h{level}" |
| 2213 | child = self.create_element(new_tag) |
| 2214 | if this_tag not in ("h1", "h2", "h3", "h4", "h5", "h6", "p"): |
| 2215 | self.append_child(child) |
| 2216 | return child |
| 2217 | self.parent.append_child(child) |
| 2218 | return child |
| 2219 | |
| 2220 | def add_horizontal_line(self): |
| 2221 | """Add horizontal line ("hr" tag)""" |
no test coverage detected