bookloupe/bookloupe.c
changeset 170 8169aeaa2790
parent 169 d14a95cb0aab
parent 165 1dd08fd3616b
child 172 ba0dcf6e6f39
     1.1 --- a/bookloupe/bookloupe.c	Wed Oct 16 20:54:58 2013 +0100
     1.2 +++ b/bookloupe/bookloupe.c	Wed Oct 16 20:57:31 2013 +0100
     1.3 @@ -3334,7 +3334,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