newsboat icon indicating copy to clipboard operation
newsboat copied to clipboard

Less-than sign leads to the rest of the line always being displayed at the top

Open dorsiflexion opened this issue 1 year ago • 3 comments

Newsboat version:

Newsboat 2.33.0
System: Linux 6.6.4-arch1-1 (x86_64)
Compiler: g++ 13.2.1 20230801
ncurses: ncurses 6.4.20230520 (compiled with 6.4)
libcurl: libcurl/8.4.0 OpenSSL/3.1.4 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) libssh2/1.11.0 nghttp2/1.58.0 (compiled with 8.3.0)
SQLite: 3.44.2 (compiled with 3.43.1)
libxml2: compiled with 2.11.5

Config file:

I don't think it matters, but here we go:

urls-source "ocnews"
ocnews-url "http://picloud.home.arpa"
ocnews-login "***"
ocnews-password "***"
ssl-verifypeer no
ssl-verifyhost no

Steps to reproduce the issue:

Example feed: https://www.kuketz-blog.de/category/artikel/feed/ Example article: https://www.kuketz-blog.de/e-datenschutzfreundlich-bedeutet-nicht-zwangslaeufig-sicher-custom-roms-teil6/ That's the second to last article in this feed. There's an even better one, which is not in the feed anymore, but I'll provide screenshots.

  1. Open an article that contains a less-than sign: <. Example line:

    rsrqResult: -17,5dB <= RSRQ < -17,0dB (8)

  2. Scroll down, so that the less-than sign is above the current displayed page and the first line of the current displayed content is an empty one.

  3. Observe this in the first (empty) line of the content:

    = RSRQ < -17,0dB (8)

Other info you think is relevant: Newsboat doesn't need to display the line first to produce this bug. You can just open the article, press "End", go up to an empty line and see it.

^L doesn't change anything.

I think this weird line of text is "always there" as soon as you are viewing article content below it. But it is hidden by everything from the article, even whitespace. Examples: Article: (empty line) leads to: = RSRQ < -17,0dB (8) Article: some text leads to: some text-17,0dB (8) Article: text leads to: text-17,0dB (8) (5 leading spaces) Article: text leads to: text

Screenshots: Said line: 1 Previously empty line containing the text after the less-than sign. Next line with a less-than sign. Line that's empty yet: 2 Empty line from screenshot 2 now containing the text from that screenshot: 3

dorsiflexion avatar Dec 08 '23 11:12 dorsiflexion

Interesting find! I've never come across this before with my feeds, but I can reproduce it with that feed and Newsboat 2.30.1-10-g96c5, that I'm running locally.

Apart from an unrelated "relative URL reference" warning in one article, the W3C feed validator does not complain about this feed. It seems to be all good.

der-lyse avatar Dec 08 '23 16:12 der-lyse

I came across the same problem with Newsboat 2.33.0.

Example feed: http://www.ruanyifeng.com/blog/atom.xml Example article: https://www.ruanyifeng.com/blog/2023/11/weekly-issue-279.html

Original HTML format line of text: 一篇老文章,介绍网页<code>&lt;a&gt;</code>标签的<code>target="_blank"</code>...

It may caused by the rich text mode of stfl. I managed to reproduce it with a piece of simple C code here:

struct stfl_ipool *ipool = stfl_ipool_create(nl_langinfo(CODESET));
const char *text = "vbox\n"
                   "  textview[article]\n"
                   "     richtext:1\n"
                   "     list:\n"
                   "            listitem text:\"some text here <>a>  some text there\"\n"
                   "            listitem text:\" \"\n"
;
struct stfl_form *f = stfl_create(stfl_ipool_towc(ipool, text));
int timeout = 100000; // a long time
stfl_ipool_fromwc(ipool, stfl_run(f, timeout));
stfl_set(f, stfl_ipool_towc(ipool, "article_offset"), stfl_ipool_towc(ipool, "2"));
stfl_ipool_flush(ipool);
stfl_ipool_fromwc(ipool, stfl_run(f, timeout));
stfl_free(f);
stfl_ipool_destroy(ipool);

run it above and press PgDn, the text after < remains: before: image after: image

The bug disappears when richtext:1\n is deleted.

CookiePieWw avatar Dec 11 '23 15:12 CookiePieWw

Sorry, I forgot to react to this. This looks like an stfl issue I previously looked into: https://github.com/dennisschagt/stfl/issues/1 I've created a fix for it (https://github.com/newsboat/stfl/commit/7b9f793ba239ca14025c9892ee412b4433126d62) but the owner of the upstream svn repo seems to have abandoned stfl. I'm not sure if any distributions would like to switch to our own stfl repo (newsboat/stfl) but we are planning to move away from stfl anyway (https://github.com/newsboat/newsboat/issues/232), so I don't want to put too much effort into it myself.

Anyway, thanks for the well-written bug report!

dennisschagt avatar Apr 29 '24 20:04 dennisschagt