diff --git a/indigo/analysis/differ.py b/indigo/analysis/differ.py index 1220ec070..c8a96a93e 100644 --- a/indigo/analysis/differ.py +++ b/indigo/analysis/differ.py @@ -209,7 +209,7 @@ def repl(match): return '\xA0' * (b - a) del_.text = ws_re.sub(repl, del_.text) - if ins is None or ins.tag != 'ins' or del_.tail: + if del_.tail or ins is None or (ins.tag != 'ins' and not (ins.get('class') or '').startswith('ins ')): ins = del_.makeelement('ins') # non-breaking space ins.text = '\xA0' diff --git a/indigo/tests/test_differ.py b/indigo/tests/test_differ.py index f125ec3ee..0623a3b4f 100644 --- a/indigo/tests/test_differ.py +++ b/indigo/tests/test_differ.py @@ -71,7 +71,7 @@ def test_inline_tag_added(self): ) self.assertEqual( - '
Some text bold text and a tail. bold text and a tail.
Some text bold text and a tail.bold text and a tail.