1.1 --- a/bookloupe/bookloupe.c Sat Oct 05 21:37:31 2013 +0100
1.2 +++ b/bookloupe/bookloupe.c Tue Oct 15 09:16:04 2013 +0100
1.3 @@ -2951,7 +2951,24 @@
1.4 for (;!g_unichar_isdigit(g_utf8_get_char(*ptr)) &&
1.5 !g_unichar_isalpha(g_utf8_get_char(*ptr)) &&
1.6 **ptr;*ptr=g_utf8_next_char(*ptr))
1.7 - ;
1.8 + {
1.9 + /* Handle exceptions for footnote markers like [1] */
1.10 + if (g_utf8_get_char(*ptr)=='[')
1.11 + {
1.12 + g_string_append_c(word,'[');
1.13 + s=g_utf8_next_char(*ptr);
1.14 + for (;g_unichar_isdigit(g_utf8_get_char(s));s=g_utf8_next_char(s))
1.15 + g_string_append_unichar(word,g_utf8_get_char(s));
1.16 + if (g_utf8_get_char(s)==']')
1.17 + {
1.18 + g_string_append_c(word,']');
1.19 + *ptr=g_utf8_next_char(s);
1.20 + return g_string_free(word,FALSE);
1.21 + }
1.22 + else
1.23 + g_string_truncate(word,0);
1.24 + }
1.25 + }
1.26 /*
1.27 * Use a look-ahead to handle exceptions for numbers like 1,000 and 1.35.
1.28 * Especially yucky is the case of L1,000