chubin / chubin/cheat.sh

ansi2html output is damaged

Open
#229 0 comments 0 reactions 0 assignees View on GitHub
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.

![image](https://user-images.githubusercontent.com/8781107/89516341-fd449d80-d7e0-11ea-8565-42fe53952cf9.png)

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.

![image](https://user-images.githubusercontent.com/8781107/89517221-169a1980-d7e2-11ea-9c7c-10f9023cdb63.png)

I have no idea why 0 is stripped in html output. At all looks very strange.

Contributor guide

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.