def _export_markdown(html, flag): """Convert to Markdown""" html = _prepare_html(html) markdown = html2text.html2text(html, bodywidth=0) if flag == 'citation': if zq.backend.csl_style == 'bibtex': markdown = '[@' + markdown.strip() + ']' return markdown
def note_to_text(note): content = html2text(to_unicode(note.content)) title = note.title.decode('utf-8') if note.tagNames: tags = ('\n'+' | '.join(note.tagNames)).decode('utf-8') else: tags = '' return title + tags + '\n' + content
def remove_html_tags(html): '''Converts an html snippet to marked-down text and returns it''' # Convert the HTML to plain text using the html2text module out = html2text (html) # Strip out the leading the trailing white space out = string.lstrip(string.rstrip (out)) return out
def _export_markdown(self, html): """Convert to Markdown """ html = self._prepare_html(html) markdown = html2text.html2text(html, bodywidth=0) if self.flag == 'citation': if self.zotquery.csl_style == 'bibtex': markdown = '[@' + markdown.strip() + ']' return markdown
def remove_html_tags(html): '''Converts an html snippet to marked-down text and returns it''' # Convert the HTML to plain text using the html2text module out = html2text(html) # Strip out the leading the trailing white space out = string.lstrip(string.rstrip(out)) return out
def ENMLtoText(contentENML): content = html2text.html2text(contentENML.decode('utf-8')) content = re.sub(r' *\n', os.linesep, content) return content.encode('utf-8')
def ENMLtoText(contentENML): content = html2text.html2text(contentENML.decode("utf-8")) content = re.sub(r" *\n", os.linesep, content) return content.encode("utf-8")