From 05eb665be914fba52ef2ab3f4dd4bc45deeb3c1c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 6 Jul 2020 13:55:49 +0530 Subject: [PATCH] Ensure annotations span styles override all others --- src/pyj/range_utils.pyj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pyj/range_utils.pyj b/src/pyj/range_utils.pyj index 33511a72e8..3a044f9646 100644 --- a/src/pyj/range_utils.pyj +++ b/src/pyj/range_utils.pyj @@ -113,6 +113,9 @@ def wrap_text_in_range(style, r, process_wrapper): wrapper_elem = document.createElement('span') wrapper_elem.dataset.calibreRangeWrapper = v'++wrapper_counter' + '' if style: + if !style.endsWith(';'): + style += ';' + style = str.replace(style, ';', ' !important;') wrapper_elem.setAttribute('style', style) intersecting_wrappers = {}