make alignment respect pandoc urls, #63
[smdp.git] / src / viewer.c
index 38985ae..0e2da58 100644 (file)
@@ -98,6 +98,9 @@ int ncurses_display(deck_t *deck, int notrans, int nofade, int invert) {
             if (line && line->text && line->text->text)
                 lc += url_count_inline(line->text->text);
 
+            if (line && line->text && line->text->text)
+                line->length -= url_len_inline(line->text->text);
+
             if(line->length > COLS) {
                 i = line->length;
                 offset = 0;
@@ -670,7 +673,7 @@ void inline_display(WINDOW *window, const char *c, const int colors) {
 
                             url_num = url_add(start_link_name, length_link_name, start_url, i - start_url, 0,0);
 
-                            wprintw(window, "[%d]", url_num);
+                            wprintw(window, " [%d]", url_num);
 
                             // turn highlighting and underlining off
                             wattroff(window, A_UNDERLINE);