Convert Token.attrs set as ``None`` or ``[[key, value], ...]`` to a dict. This improves compatibility with upstream markdown-it.
(value: Any)
| 7 | |
| 8 | |
| 9 | def convert_attrs(value: Any) -> Any: |
| 10 | """Convert Token.attrs set as ``None`` or ``[[key, value], ...]`` to a dict. |
| 11 | |
| 12 | This improves compatibility with upstream markdown-it. |
| 13 | """ |
| 14 | if not value: |
| 15 | return {} |
| 16 | if isinstance(value, list): |
| 17 | return dict(value) |
| 18 | return value |
| 19 | |
| 20 | |
| 21 | @dc.dataclass(slots=True) |
no outgoing calls
no test coverage detected
searching dependent graphs…