Pre-existing bugs found while reviewing #151
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
The five bugs sit in gh-md-toc: the HTTP status check in gh_toc_load (around L38), the stdin read loop (L421-425), the error output (L160-171), and the single-line sed in gh_toc_grab (L290). The issue says to wait for #151, which changes the stdin block and error output, so check that PR first. Done means each checkbox is fixed and reproduced on both Linux and macOS, with the issue's examples giving the expected output.
索引モデルが issue の本文から書いたものです。
説明
Found while reviewing #151. All of these reproduce on current master (9e0a858), #151 doesn't introduce them. Line numbers refer to gh-md-toc at 9e0a858.
- Remote URL ignores the HTTP status (
gh_toc_load, L38).curl -sonly fails on network errors, so./gh-md-toc https://github.com/ekalinin/github-markdown-toc/blob/master/NOPE-404.mdprints an empty TOC and exits 0. - stdin input is changed before it is sent (L423-425).
while read -r input; do echo "$input" >> ...strips leading whitespace, drops a last line without a trailing newline, andechoswallows lines like-n. Forprintf '# A\n\n # indented code\n-n\n# Last' | ./gh-md-toc -the API gets only# A, an empty line and# indented code, so the indented code block becomes a heading and# Lastis lost.cat > "$gh_tmp_md"would keep the input as is. - The stdin temp file is never removed (L421). Every
gh-md-toc -run leaves atmp.XXXXXXfile with the input markdown in$TMPDIR. - Errors go to stdout (L160-171). The network and rate-limit errors are printed with plain
echo, so./gh-md-toc README.md > toc.mdwrites the error text intotoc.mdunder the "Table of Contents" header. The exit code is 1, but the error ends up in the output file. - The rate-limit hint always points to
token.txt(L168-169). It's printed even whenGH_TOC_TOKENis set, and in that casetoken.txtis ignored. - Single-line HTML gives an empty TOC on macOS (
gh_toc_grab, L290). BSD sed'sNon the last line quits without printing, sosed -e ':a' -e 'N' -e '$!ba' ...outputs nothing for one-line input. A document with only one heading renders to one line of HTML, soprintf '# A\n' | ./gh-md-toc -prints an empty TOC on macOS, whileprintf '# A\n\n## B\n'works.
#151 changes the stdin block and the error output, so it's easier to fix these after it's merged.
- 主要言語
- Shell
- スター
- 3.3k
- フォーク
- 2.7k
- 平均マージ
- 3時間 21分
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ekalinin/github-markdown-toc のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
ekalinin/github-markdown-toc#176 ·
メンテナーはふだん 1 日以内に返信
-
Update outdated examples and versions in README対応中かも @SatvikMishra08 が 22 日前に担当しました。 オープンdocumentation
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
ekalinin/github-markdown-toc#165 ·
メンテナーはふだん 1 日以内に返信
-
[Feature] `--no-code-tag-removal` flag allowing to make removal of backticks in TOC entries optional対応中かも @jofas が 806 日前に担当しました。 オープンenhancement
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
ekalinin/github-markdown-toc#153 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
ekalinin/github-markdown-toc#152 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
ekalinin/github-markdown-toc#141 ·
メンテナーはふだん 1 日以内に返信
ekalinin/github-markdown-toc の issue をすべて見る
似ている issue
-
fix(backup-uploader): write current-round marker outside / so the container can run as non-rootオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
hiero-ledger/solo-containers#254 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CachyOS/cachyos-hooks#23 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
bug cli security sev-6
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
area/cli good first issue size/S type/feature
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
lorica-labs/volant#549 ·
メンテナーはふだん 1 日以内に返信