mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
c63ff81d96
commit
985d382f1a
@ -1,12 +1,15 @@
|
|||||||
import re, sys
|
import re, sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
from lxml.etree import tostring, tounicode
|
from lxml.etree import tostring
|
||||||
from lxml.html import fragment_fromstring, document_fromstring
|
from lxml.html import fragment_fromstring, document_fromstring
|
||||||
|
|
||||||
from calibre.ebooks.readability.htmls import build_doc, get_body, get_title, shorten_title
|
from calibre.ebooks.readability.htmls import build_doc, get_body, get_title, shorten_title
|
||||||
from calibre.ebooks.readability.cleaners import html_cleaner, clean_attributes
|
from calibre.ebooks.readability.cleaners import html_cleaner, clean_attributes
|
||||||
|
|
||||||
|
def tounicode(tree_or_node, **kwargs):
|
||||||
|
kwargs['encoding'] = unicode
|
||||||
|
return tostring(tree_or_node, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
REGEXES = {
|
REGEXES = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user