mrusme / reader

reader is for your command line what the “readability” view is for modern browsers: A lightweight tool offering better readability of web pages on the CLI.
https://xn--gckvb8fzb.com/reader-web-page-readability-on-the-cli/
GNU General Public License v3.0
258 stars 9 forks source link

[BUGS] 1. Bad output in a edge case, 2. Bad output with extra backslash #18

Open Disonantemus opened 7 months ago

Disonantemus commented 7 months ago
  1. Three asterisks alone (edge case) bad rendered
$ reader https://readhive.org/series/38553/0/ | sed -n 25p
\\\\\\*

$ reader -o https://readhive.org/series/38553/0/ | sed -n 21p
\\*\\*\\*

$ reader -o https://readhive.org/series/38553/0/ | sed -n 21p | lowdown | w3m -T text/html -dump
\\\*

$ reader -o https://readhive.org/series/38553/0/ | sed -n 21p | glow
\\\\\\*

$ ### firefox (default, output centered):
***

$ ### firefox (reader view):
***

$ ### reader -o (output to github "GFM"):
\\*\\*\\*

When the web page has a line with only 3 consecutive asterisks (***), the markup code should displays an horizontal line, but in this case, it should have at least one escape character \ (backslash) before, so that it is displayed correctly. Below are three correct ways to write that will be displayed good, the last one is incorrect (horizontal line) and can optionally be written as ---:

$ echo '\***' | lowdown
<p>***</p>
$ echo '\*\**' | lowdown
<p>***</p>
$ echo '\*\*\*' | lowdown
<p>***</p>
$ echo '***' | lowdown
<hr/>
  1. Extra unnecessary (and problematic) backslash, escaping square brackets
$ reader https://readhive.org/series/38553/0/ | sed -n 48p
\[… There is no end in sight.\]

$ reader -o https://readhive.org/series/38553/0/ | sed -n 41p
\[… There is no end in sight.\]

$ reader -o https://readhive.org/series/38553/0/ | sed -n 41p | lowdown | w3m -T text/html -dump
[… There is no end in sight.]

$ reader -o https://readhive.org/series/38553/0/ | sed -n 41p | glow
\[… There is no end in sight.\]

$ ### firefox (default, output centered):
[… There is no end in sight.]

$ ### firefox (reader view):
[… There is no end in sight.]

$ ### reader -o (output to github):
[… There is no end in sight.]