this patch fixes the wrong positioning of links when navigating links that
follow a LEFT-TO-RIGHT-MARK (U+200e) or a RIGHT-TO-LEFT-MARK (U+200f)

-----------

diff -Naur elinks-0.13-20170507/src/document/html/renderer.c 
elinks-0.13-modified/src/document/html/renderer.c
--- elinks-0.13-20170507/src/document/html/renderer.c   2017-03-06 
21:47:40.000000000 +0100
+++ elinks-0.13-modified/src/document/html/renderer.c   2017-05-07 
14:37:16.000000000 +0200
@@ -640,7 +640,9 @@
 #endif /* CONFIG_COMBINE */
                                part->spaces[x] = (data == UCS_SPACE);

-                               if (unicode_to_cell(data) == 2) {
+                               if (unicode_to_cell(data) == 0)
+                                       continue;
+                               else if (unicode_to_cell(data) == 2) {
                                        schar->data = (unicode_val_T)data;
                                        part->char_width[x] = 2;
                                        copy_screen_chars(&POS(x++, y), schar, 
1);
diff -Naur elinks-0.13-20170507/src/intl/charsets.c 
elinks-0.13-modified/src/intl/charsets.c
--- elinks-0.13-20170507/src/intl/charsets.c    2017-03-06 21:47:40.000000000 
+0100
+++ elinks-0.13-modified/src/intl/charsets.c    2017-05-07 14:40:03.000000000 
+0200
@@ -605,12 +605,13 @@
  * libc version of wcwidth, and instead use a hardcoded mapping.
  *
  * @return     2 for double-width glyph, 1 for others.
- *             TODO: May be extended to return 0 for zero-width glyphs
- *             (like composing, maybe unprintable too).
+ *             0 for unprintable glyphs (like 0x200e: "LEFT-TO-RIGHT MARK")
  */
 NONSTATIC_INLINE int
 unicode_to_cell(unicode_val_T c)
 {
+       if (c == 0x200e || c == 0x200f)
+               return 0;
        if (c >= 0x1100
                && (c <= 0x115f                      /* Hangul Jamo */
                || c == 0x2329
--
http://lists.linuxfromscratch.org/listinfo/elinks-dev
Unsubscribe: See the above information page

Reply via email to