From 7266ac4cbd6a09702c0a566c5faf9ccb4c539867 Mon Sep 17 00:00:00 2001
From: hedy
at the end, both redundant; but since the HTML is parsed and rendered later on, it does not seem to alter how the document would look.
First para
Second line
Second para
I could possibly add a `first_paragraph` variable and a `i != buffer->length` check to remove the first
and lastin the HTML, making the HTML source "prettier". But I don't believe that would be too beneficial, considering the performance tradeoff in executing these two extra checks for each empty new line encountered. For testing please see: gemini://hedy.tilde.cafe/tmp/paragraphs.gmi --- src/document/gemini/renderer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/document/gemini/renderer.c b/src/document/gemini/renderer.c index 18835ee8..2a96511c 100644 --- a/src/document/gemini/renderer.c +++ b/src/document/gemini/renderer.c @@ -152,6 +152,10 @@ render_gemini_document(struct cache_entry *cached, struct document *document, if (buffer->source[i] == 13 || buffer->source[i] == 10) break; } + if (begin == i) { + add_to_string(&html, "
"); + } + if (begin < i) { int len = i - begin;