From cc0997dc48c73a1a00101c006d9e2681ff535f49 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 9 May 2017 12:51:46 +0530 Subject: [PATCH] Strip comments from book details css --- src/calibre/gui2/book_details.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/book_details.py b/src/calibre/gui2/book_details.py index 0bb5073594..0f180a0dfa 100644 --- a/src/calibre/gui2/book_details.py +++ b/src/calibre/gui2/book_details.py @@ -2,7 +2,7 @@ # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai # License: GPLv3 Copyright: 2010, Kovid Goyal -import cPickle +import cPickle, re from binascii import unhexlify from collections import namedtuple from functools import partial @@ -40,9 +40,10 @@ InternetSearch = namedtuple('InternetSearch', 'author where') def css(): global _css if _css is None: - _css = P('templates/book_details.css', data=True).decode('utf-8') + val = P('templates/book_details.css', data=True).decode('utf-8') col = QApplication.instance().palette().color(QPalette.Link).name() - _css = _css.replace('LINK_COLOR', col) + val = val.replace('LINK_COLOR', col) + _css = re.sub(ur'/\*.*?\*/', '', val, flags=re.DOTALL) return _css