From 9a169c86c722828eb5e6ebdc16ffd88b528dee8c Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 28 May 2019 22:33:48 -0400 Subject: [PATCH] remove unused code This function is no longer used since commit 4cd285859b6721c48eefd9b23fe47b0bfc5ab871 --- src/calibre/ebooks/html/__init__.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/calibre/ebooks/html/__init__.py b/src/calibre/ebooks/html/__init__.py index d37f1f1f96..720ff711e6 100644 --- a/src/calibre/ebooks/html/__init__.py +++ b/src/calibre/ebooks/html/__init__.py @@ -5,27 +5,3 @@ from __future__ import absolute_import, division, print_function, unicode_litera __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' - -import re - - -def tostring(root, strip_comments=False, pretty_print=False): - ''' - Serialize processed XHTML. - ''' - from lxml.etree import tostring as _tostring - - root.set('xmlns', 'http://www.w3.org/1999/xhtml') - root.set('{http://www.w3.org/1999/xhtml}xlink', 'http://www.w3.org/1999/xlink') - for x in root.iter(): - if hasattr(x.tag, 'rpartition') and x.tag.rpartition('}')[-1].lower() == 'svg': - x.set('xmlns', 'http://www.w3.org/2000/svg') - - ans = _tostring(root, encoding='utf-8', pretty_print=pretty_print) - if strip_comments: - ans = re.compile(r'', re.DOTALL).sub('', ans) - ans = '\n'+ans - - return ans - -