diff --git a/src/document/gemini/renderer.c b/src/document/gemini/renderer.c index 84bcbfbf..4861a752 100644 --- a/src/document/gemini/renderer.c +++ b/src/document/gemini/renderer.c @@ -165,6 +165,7 @@ render_gemini_document(struct cache_entry *cached, struct document *document, string_replace(&html, &line, &gem_pre, repl); } else if (preformat) { add_string_to_string(&html, &line); + add_char_to_string(&html, '\n'); } else { struct string html_line; @@ -189,7 +190,7 @@ render_gemini_document(struct cache_entry *cached, struct document *document, } } begin = i + 1; - add_to_string(&html, "\n"); + if (!preformat) add_to_string(&html, "\n"); } add_to_string(&html, ""); diff --git a/src/protocol/gemini/gemini.c b/src/protocol/gemini/gemini.c index d09fb1dd..60358b24 100644 --- a/src/protocol/gemini/gemini.c +++ b/src/protocol/gemini/gemini.c @@ -313,8 +313,8 @@ again: } init_string(&head_string); - add_to_string(&head_string, "\nContent-Type:"); - add_bytes_to_string(&head_string, rb->data + 2, a); + add_to_string(&head_string, "\nContent-Type: "); + add_bytes_to_string(&head_string, rb->data + 3, a - 2); if (!conn->cached) { done_string(&head_string);