diff --git a/README.md b/README.md
index 80695023b563475331438ce368d70f77ff6f24ca..eabc77ea5a6dd0f73bd908fa5a52b03fd53ddcce 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@ - heading 3: light green
-- quote: light gray
+- preformatted text: light gray
Besides this rendering adjustments i'll try to keep track of upstream changes or send patches to upstream.
diff --git a/src/gmnlm.c b/src/gmnlm.c
index 8e85d091e54e3c3c11dbd6980ae660be6838c7c8..66db54c7e0cf7dd6a1f58872621cc28e69944134 100644
--- a/src/gmnlm.c
+++ b/src/gmnlm.c
@@ -23,7 +23,7 @@ #define ANSI_COLOR_RED "\x1b[91m"
#define ANSI_COLOR_GREEN "\x1b[92m"
#define ANSI_COLOR_YELLOW "\x1b[93m"
#define ANSI_COLOR_BLUE "\x1b[94m"
-#define ANSI_COLOR_MAGENTA "\x1b[95m"
+#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_CYAN "\x1b[36m"
#define ANSI_COLOR_LCYAN "\x1b[96m"
#define ANSI_COLOR_GRAY "\x1b[37m"
@@ -70,7 +70,7 @@
const char *default_bookmarks =
"# Welcome to cgmnlm\n\n"
"Links:\n\n"
"=> gemini://gemini.circumlunar.space The gemini protocol\n\n"
"This file can be found at %s and may be edited at your pleasure.\n\n"
"Bookmarks:\n"
@@ -809,20 +809,20 @@ while (text != NULL || gemini_parser_next(&p, &tok) == 0) {
repeat:
switch (tok.token) {
case GEMINI_TEXT:
col += fprintf(out, " ");
col += fprintf(out, " ");
if (text == NULL) {
text = tok.text;
}
break;
case GEMINI_LINK:
if (text == NULL) {
col += fprintf(out, "%2d) %s", nlinks++, (!strncmp("gemini://", tok.link.url, 9)) ? ANSI_COLOR_CYAN : ((strstr(tok.link.url, "://") == NULL) ? ANSI_COLOR_LCYAN : ANSI_COLOR_MAGENTA));
col += fprintf(out, "%3d) %s", nlinks++, (!strncmp("gemini://", tok.link.url, 9)) ? ANSI_COLOR_CYAN : ((strstr(tok.link.url, "://") == NULL) ? ANSI_COLOR_LCYAN : ANSI_COLOR_MAGENTA));
text = trim_ws(tok.link.text ? tok.link.text : tok.link.url);
*next = calloc(1, sizeof(struct link));
(*next)->url = strdup(trim_ws(tok.link.url));
next = &(*next)->next;
} else {
col += fprintf(out, " ");
col += fprintf(out, " ");
}
break;
case GEMINI_PREFORMATTED_BEGIN:
@@ -832,7 +832,7 @@ case GEMINI_PREFORMATTED_END:
continue; // Not used
case GEMINI_PREFORMATTED_TEXT:
if (text == NULL) {
fprintf(out, " ");
fprintf(out, " %s", ANSI_COLOR_GRAY);
text = tok.preformatted;
}
break;
@@ -843,32 +843,31 @@ }
if (text == NULL) {
switch (tok.heading.level) {
case 1:
col += fprintf(out, "%s%s", " # ", ANSI_COLOR_RED);
col += fprintf(out, " # %s", ANSI_COLOR_RED);
break;
case 2:
col += fprintf(out, "%s%s", " ## ", ANSI_COLOR_YELLOW);
col += fprintf(out, " ## %s", ANSI_COLOR_YELLOW);
break;
case 3:
col += fprintf(out, "%s%s", "### ", ANSI_COLOR_GREEN);
col += fprintf(out, " ### %s", ANSI_COLOR_GREEN);
break;
}
text = trim_ws(tok.heading.title);
} else {
col += fprintf(out, " ");
col += fprintf(out, " ");
}
break;
case GEMINI_LIST_ITEM:
if (text == NULL) {
col += fprintf(out, " %s ",
col += fprintf(out, " %s ",
browser->unicode ? "•" : "*");
text = trim_ws(tok.list_item);
} else {
col += fprintf(out, " ");
col += fprintf(out, " ");
}
break;
case GEMINI_QUOTE:
col += fprintf(out, " %s%s %s", ANSI_COLOR_RESET,
browser->unicode ? "┃" : ">", ANSI_COLOR_GRAY);
col += fprintf(out, " %s ", browser->unicode ? "┃" : ">");
if (text == NULL) {
text = trim_ws(tok.quote_text);
}
text/gemini
This content has been proxied by September (ba2dc).