def role(typ, rawtext, text, lineno, inliner, options={}, content=[]): if not extension.is_isolated: content = Element('span') content.text = utils.unescape(text) else: content = utils.unescape(text) element = extension.process({}, content) return [zeml(zeml=element)], []
def parse(self, input_data, reason): intro_t, body_t = htmlize_markup(input_data, reason) intro = sanitize(parse_zeml(intro_t)) body = sanitize(parse_zeml(body_t)) # The following complicated procedure is required only because # Zine provides no way to cast RootElement objects (which `intro` # and `body` are) into Element objects (which `intro` needs to become) if intro_t: newintro = Element('intro') newintro.children.extend(intro.children) newintro.text = intro.text for child in newintro.children: child.parent = newintro body.children.insert(0, newintro) newintro.parent = body newintro.tail = body.text body.text = u'' return body