def _processHtml(self, mime): if not mime.hasHtml(): return None, False html = mime.html() # no filtering required for internal pastes if html.startswith("<!--anki-->"): return html[11:], True return html, False
def _processHtml(self, mime: QMimeData) -> Tuple[Optional[str], bool]: if not mime.hasHtml(): return None, False html = mime.html() # no filtering required for internal pastes if html.startswith("<!--anki-->"): return html[11:], True return html, False
) or "cible" in key.lower() or "zone" in key.lower(): key = "Cible ou zone d'effet" key = key.replace("’", "'") if key in FIELDS: sort[key] = text.strip() descr = s.next_siblings text = "" else: print("- Skipping unknown property %s" % key) # lire la description extracts = extractText(descr) plain = extracts['text'] html = extracts['html'] if html.startswith('<br/>'): html = html[5:] sort['Description'] = plain.strip() sort['DescriptionHTML'] = html # ajouter sort liste.append(sort) #if MOCK_SORT: # break print("Fusion avec fichier YAML existant...") HEADER = ""
def format_item(self, item): html = markdown2html(item['glossary']) if html.startswith('<p>'): html = html[3:-4] item['glossary'] = html return item