from panflute import Div,Span from util import * from typing import List class Command: pass class InlineCommand(Span, Command): def replaceSelf(self, content: List[Element]) -> Span: if "c" in r.attributes: del r.attributes["c"] return replaceEl(self, Span(*content)) pass class MultilineCommand(Div, Command): def replaceSelf(self, content: List[Element]) -> Div: if "c" in r.attributes: del r.attributes["c"] return replaceEl(self, Div(*content)) pass