Subject: htmlfontify fails to generate highly highlighted regions

From: Hong Xu <[email-masked]>
Date: Sun, 22 Nov 2015 20:43:14 -0800

I'm able to reproduce this issue on both the latest snapshot and 24.4.
My OS is GNU/Linux.

To reproduce this issue, follow the following steps:

1. Start emacs with "-q" option in GUI mode and copy the following texts
to emacs and view them in diff mode:

BEGIN================================

diff --git a/gajim.py.orig b/gajim.py
index 57e61e62e8d1..82e36fee351d 100644
--- a/gajim.py.orig
+++ b/gajim.py
@@ -36,12 +36,12 @@
 ##

 import os
-import sys
+xxxxxxxxxxxximport sys
 import warnings

 if os.name == 'nt':
     log_path = os.path.join(os.environ['APPDATA'], 'Gajim')
-    if not os.path.exists(log_path):
+    f not os.path.exists(log_path):
         os.mkdir(log_path, 0o700)
     log_file = os.path.join(log_path, 'gajim.log')
     fout = open(log_file, 'a')
@@ -523,7 +523,7 @@ if __name__ == '__main__':
     check_paths.check_and_possibly_create_paths()

     interface = Interface()
-    interface.run()
+   interface.run()

     try:
         Gtk.main()

END ===================================

2. Press Meta-n multiple times to make sure all changed texts are
highlighted. It should look like the following:

    https://i.imgur.com/xVdQgxk.png

3. M-x htmlfontify-buffer, and save the output html file.

4. Look at it in a browser. The deeply highlighted region (such as the
"xxxxxxxxxx") is not highlighted at all.

My HTML output is attached so you can view it.