ansi2html output is damaged
- Dominant language
- Python
- Stars
- 41.7k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
This is a very strange bug. This is screen from current `cheat.sh` version that I've just built and run locally through `docker-compose`. Note the broken link https://github.com/chubin/issues/14 which should lead to #14.

Now, if we look at the source, the actual broken link ends with `issues/140` and it was that from the start.
Note the https://github.com/chubin/cheat.sh/blob/9f99bec1f0293e84d6d8a990a1940c1422e3b0ce/lib/adapter/upstream.py#L30
With the exception of missing `/cheat.sh/` part in URL, the link seems legit. Perhaps my `docker-compose` fetched the content from some server where the content was fixed, but not committed. But fetching the same local URL with `curl` shows 140 and not 14.

I have no idea why 0 is stripped in html output. At all looks very strange.
Contributor guide
Research direction
Start with lib/adapter/upstream.py#L30 and compare the source URL containing issues/140 with the ansi2html-rendered output. Reproduce the conversion locally using the Docker Compose setup and curl, then trace why the trailing 0 disappears. Done means links such as the one targeting issue 140 remain unchanged in HTML output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100