From 7bd05cbfeb81d0603326d61d6e099ef3820d0512 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 25 Mar 2019 20:01:13 +0530 Subject: [PATCH] Another bs4 incompat to port --- src/calibre/gui2/lrf_renderer/text.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/lrf_renderer/text.py b/src/calibre/gui2/lrf_renderer/text.py index a8c59c7561..aa962741d5 100644 --- a/src/calibre/gui2/lrf_renderer/text.py +++ b/src/calibre/gui2/lrf_renderer/text.py @@ -8,7 +8,6 @@ from PyQt5.Qt import ( QFontMetrics, QPen, QBrush, QGraphicsRectItem) from calibre.ebooks.lrf.fonts import LIBERATION_FONT_MAP -from calibre.ebooks.BeautifulSoup import Tag from calibre.ebooks.hyphenate import hyphenate_word from polyglot.builtins import unicode_type, string_or_bytes @@ -164,8 +163,13 @@ class TextBlock(object): pass has_content = property(fget=lambda self: self.peek_index < len(self.lines)-1) - XML_ENTITIES = dict(zip(Tag.XML_SPECIAL_CHARS_TO_ENTITIES.values(), Tag.XML_SPECIAL_CHARS_TO_ENTITIES.keys())) - XML_ENTITIES["quot"] = '"' + XML_ENTITIES = { + "apos" : "'", + "quot" : '"', + "amp" : "&", + "lt" : "<", + "gt" : ">" + } def __init__(self, tb, font_loader, respect_max_y, text_width, logger, opts, ruby_tags, link_activated):