blmayer / ereandel

A Gemini web browser using shell script
gemini://terminal.pink/
MIT License
56 stars 6 forks source link

typesetting broken on specific percent-encoded URIs #39

Closed rnwgnr closed 1 year ago

rnwgnr commented 1 year ago

Came across this on station.martinrue.com - text on the capsule: gemini://gemi.dev/cgi-bin/waffle.cgi/article?https%3A%2F%2Fpluralistic.net%2F2023%2F08%2F03%2Fthere-is-no-cloud%2F%23linkdump

This brings astro to issue a warning: astro: line 205: printf: '\': invalid format character

The URI is broken in output then: gemini://gemi.dev/cgi-bin/waffle.cgi/article?https%3A%2F%2Fpluralistic.net%2F2023 0,00000008%2F03%2Fthere-is-no-cloud%2F%23linkdump

blmayer commented 1 year ago

Thanks for reporting this. I think astro will need to escape percents. I'll take a look.

rnwgnr commented 1 year ago

Just a heads up - shellcheck complains about the newly introduced echo:

In astro line 203:
                echo -e "$sty$txt"
                                     ^-- SC3037 (warning): In POSIX sh, echo flags are undefined.

Besides that - getting rid of the sed for escaping % improved typesetting performance by a noticable gain. ;)

blmayer commented 1 year ago

Thanks, just fixed this.

rnwgnr commented 1 year ago

both tags 0.22.0 and 0.22.1 reference the same commit - did you miss a git push or something?

blmayer commented 1 year ago

Wow, what a shame. Thanks for catching this.