txt2html

Converts plaintext to HTML
git clone git://src.gearsix.net/txt2html
Log | Files | Refs | Atom | README

commit 75a996dcf73392b66ccf7ea34b3dff9654e464e1
parent f34ed785bd5ed318fa98d3dfcf468d1658de4e46
Author: gearsix <gearsix@tuta.io>
Date:   Wed, 30 Jun 2021 20:15:32 +0100

removed pread, was used during dev in last tidyup

Diffstat:
Mtxt2html.c | 35-----------------------------------
1 file changed, 0 insertions(+), 35 deletions(-)

diff --git a/txt2html.c b/txt2html.c @@ -86,7 +86,6 @@ struct node *txt2html(char *txt) writebuf(n, txt[i]); } ++i; -// i = readp(n, txt, i); break; default: if (isalnum(txt[i]) && txt[i+1] == '.' && txt[i+2] == ' ') { @@ -245,37 +244,3 @@ int isheading(char *txt, int i) return 0; } -// -int readp(struct node *n, char *txt, int i) -{ - if (n == NULL || txt == NULL) - return 0; - - const int len = strlen(txt); - if (i > len) { - n = closenode(n); - return EOF; - } - - if (txt[i] == '\n') { - if (i+1 <= len && txt[i+1] == '\n') { - n = closenode(n); - ++i; - } else if (opts & OPT_HB) { - n = newnode(n, OPEN+BR+CLOSE, n+1); - n = newnode(n, P, n+1); - } else { - writebuf(n, ' '); - } - ++i; - } else while (i < len && txt[i] != '\n') - writebuf(n, txt[i++]); - - if (i == len) { - n = closenode(n); - i = EOF; - } - - return i; -} -