commit d804a1b1bb6a74351b5b34cfef88256b75f6f21e from: Omar Polo date: Fri Sep 24 16:28:54 2021 UTC switch from ^L to a line of only `-' The ^L implementation was ugly and wrong. Using a character from the already allowed set is better. Also, the motivation for ^L was to avoid breaking existing pages (as much as possible). But using a line consisted of only `-' shouldn't break anything, but only improve the legibility. In the future other characters may be added (like a line of only EN DASH or EM DASH for example.) commit - 828b14926efd83e2a4ad1557974e98d87b16e733 commit + d804a1b1bb6a74351b5b34cfef88256b75f6f21e blob - 94fd896ef22984ed7ca602e84655c00c896fe2e7 blob + 3677a37fdf65203a8209a0bbff32432245163cda --- parser.c +++ parser.c @@ -156,7 +156,7 @@ parser_foreach_line(struct parser *p, const char *buf, /* drop every "funny" ASCII character */ for (i = 0; i < len; ) { ch = b[i]; - if ((ch >= ' ' || ch == '\n' || ch == '\t' || ch == '\f') + if ((ch >= ' ' || ch == '\n' || ch == '\t') && ch != 127) { /* del */ ++i; continue; blob - d97ef8a406db8176d013dc5e6b7e1618d1859a4e blob + 4d463365fb7b7684db68a4d5bff3a00898b86c0d --- parser_gemtext.c +++ parser_gemtext.c @@ -322,6 +322,8 @@ parse_pre_end(struct parser *p, enum line_type t, cons static inline enum line_type detect_line_type(const char *buf, size_t len, int in_pre) { + size_t i; + if (in_pre) { if (len >= 3 && buf[0] == '`' && buf[1] == '`' && buf[2] == '`') @@ -358,7 +360,10 @@ detect_line_type(const char *buf, size_t len, int in_p if (buf[0] == '`' && buf[1] == '`' && buf[2] == '`') return LINE_PRE_START; break; - case 0xC: /* form feed */ + case '-': + for (i = 0; i < len; ++i) + if (buf[i] != '-') + return LINE_TEXT; return LINE_BREAK; }