Pop tag matching given style name.
(style_name: str)
| 144 | _Tag = Tag |
| 145 | |
| 146 | def pop_style(style_name: str) -> Tuple[int, Tag]: |
| 147 | """Pop tag matching given style name.""" |
| 148 | for index, (_, tag) in enumerate(reversed(style_stack), 1): |
| 149 | if tag.name == style_name: |
| 150 | return pop(-index) |
| 151 | raise KeyError(style_name) |
| 152 | |
| 153 | for position, plain_text, tag in _parse(markup): |
| 154 | if plain_text is not None: |