+ inline_display(window, &line->text->value[offset], colors);
+ }
+ }
+ }
+
+ // fill rest off line with spaces
+ // we only need this if the color is inverted (e.g. code-blocks),
+ // to ensure the background fades too
+ if(CHECK_BIT(line->bits, IS_CODE))
+ for(i = getcurx(window) - x; i < max_cols; i++)
+ wprintw(window, "%s", " ");
+
+ // reset to default color
+ if(colors)
+ wattron(window, COLOR_PAIR(CP_WHITE));
+ wattroff(window, A_UNDERLINE);
+}
+
+void inline_display(WINDOW *window, const wchar_t *c, const int colors) {
+ const static wchar_t *special = L"\\*_`!["; // list of interpreted chars
+ const wchar_t *i = c; // iterator
+ const wchar_t *start_link_name, *start_url;
+ int length_link_name, url_num;
+ cstack_t *stack = cstack_init();
+
+
+ // for each char in line
+ for(; *i; i++) {
+
+ // if char is in special char list
+ if(wcschr(special, *i)) {
+
+ // closing special char (or second backslash)
+ // only if not followed by :alnum:
+ if((stack->top)(stack, *i) &&
+ (!iswalnum(i[1]) || *(i + 1) == L'\0' || *i == L'\\')) {
+
+ switch(*i) {
+ // print escaped backslash
+ case L'\\':
+ waddnwstr(window, i, 1);
+ break;
+ // disable highlight
+ case L'*':
+ if(colors)
+ wattron(window, COLOR_PAIR(CP_WHITE));
+ break;
+ // disable underline
+ case L'_':
+ wattroff(window, A_UNDERLINE);
+ break;
+ // disable inline code
+ case L'`':
+ if(colors)
+ wattron(window, COLOR_PAIR(CP_WHITE));
+ break;