1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-27 02:56:18 -04:00
elinks/src/document
hedy 7266ac4cbd
[gemini] Use paragraph tags on gemtext empty lines
This patch makes paragraphs separated by an empty new line appear after
an empty new line when rendered in elinks.

Previously, for a gemtext source that looks like this:

    First para
    Second line

    Second para

It renders like this:

    First para
    Second line
    Second para

After this patch, they now render like this:

    First para
    Second line

    Second para

Unfortunately this also adds a </p> to the start of the HTML, as well as
a <p> 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.

    </p><p> First para <br> Second line </p><p> Second para </p><p>

I could possibly add a `first_paragraph` variable and a `i !=
buffer->length` check to remove the first </p> and last <p> in 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
2023-09-28 15:48:59 +08:00
..
css [css] line-through 2023-08-25 20:53:26 +02:00
dom [line] union in place of struct (sixel) 2023-05-18 11:12:05 +02:00
gemini [gemini] Use paragraph tags on gemtext empty lines 2023-09-28 15:48:59 +08:00
html [terminal] Strikethrough for <STRIKE> element 2023-08-25 20:10:54 +02:00
libdom [br] Shorter code 2023-09-14 17:57:56 +02:00
plain [plain] Compilation fix. Refs #239 2023-06-20 13:58:14 +02:00
docdata.c Doxygenate src/document/ (but not subdirs) 2007-07-28 02:34:59 +03:00
docdata.h [mozjs24] Allow build elinks with g++ 2020-10-05 20:14:55 +02:00
document.cpp [spidermonkey] element.focus() 2023-09-11 15:48:18 +02:00
document.h [spidermonkey] element.focus() 2023-09-11 15:48:18 +02:00
format.c [terminal] Strikethrough for <STRIKE> element 2023-08-25 20:10:54 +02:00
format.h [terminal] Strikethrough for <STRIKE> element 2023-08-25 20:10:54 +02:00
forms.c [forms] const in form_type_name 2022-02-15 17:28:44 +01:00
forms.h [lists] LIST_HEAD -> LIST_HEAD_EL to not clash with libevent's LIST_HEAD. Also added curl implementation of ftpes and sftp 2023-06-19 18:43:53 +02:00
Makefile [css] Removed css2 (xml code) 2023-05-05 20:23:40 +02:00
meson.build [css] Removed css2 (xml code) 2023-05-05 20:23:40 +02:00
options.c [options] Added bool option document.plain.sixel 2023-05-26 19:46:07 +02:00
options.h [options] Added bool option document.plain.sixel 2023-05-26 19:46:07 +02:00
refresh.c [html] cast 2022-01-25 18:02:25 +01:00
refresh.h [cflags] Removed -Wno-pointer-sign 2021-01-02 16:20:27 +01:00
renderer.cpp [libdom] scan_http_equiv in libdom renderer. Refs #249 2023-07-27 13:30:42 +02:00
renderer.h [cflags] Removed -Wno-pointer-sign 2021-01-02 16:20:27 +01:00
view.h [lists] LIST_HEAD -> LIST_HEAD_EL to not clash with libevent's LIST_HEAD. Also added curl implementation of ftpes and sftp 2023-06-19 18:43:53 +02:00