docs: restore eight markdown links mangled into NUL bytes - #15756
Open
devGregA wants to merge 2 commits into
Open
docs: restore eight markdown links mangled into NUL bytes#15756devGregA wants to merge 2 commits into
devGregA wants to merge 2 commits into
Conversation
`docs/content/connectors/upstream/toolreference.md` carried six literal NUL bytes (0x00) that broke three inline markdown links. Each one is a leftover placeholder of the form `\0<index>\0` sitting where the link destination `](url)` belongs: - Semgrep token page: `[https://semgrep.dev/orgs/\-/settings/tokens\0389\0)` - Snyk REST base: `**[https://api.snyk.io/rest\0394\0**` - Snyk EU REST base: `**[https://api.eu.snyk.io/rest\0395\0**` The NUL bytes also made the whole file register as binary, so `grep` skipped it and `git diff` rendered it as "Binary files differ". The placeholders were introduced in 1cafb09 (DefectDojo#15661); its parent 1e48e93 still has the intact text, and all four translated siblings (`.de`, `.es`, `.fr`, `.ja`) carry the same markup unchanged. Both sources agree, so the destinations are restored verbatim from them - the two repaired lines are now byte-identical to their pre-DefectDojo#15661 counterparts. The file contains no NUL bytes after this change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Same defect as the previous commit, same origin (1cafb09 / DefectDojo#15661): a placeholder of the form \0<index>\0 left sitting where a link destination `](url)` belongs. A repo-wide scan found four more affected files carrying ten NUL bytes between them: - get_started/about/about_defectdojo.md (2: demo, pro demo) - get_started/contributing/documentation.md (1: http://localhost:1313) - get_started/contributing/how-to-write-a-parser.md (1: acunetix.md example) - issue_tracking/pro_integration/messaging_connectors.md (1: api.slack.com/apps) Each destination is restored verbatim from the last revision of that file before DefectDojo#15661, located by walking the file history and counting NUL bytes per revision. All five are self-links (display text equals destination), and every repaired line is byte-identical to its pre-DefectDojo#15661 counterpart. No NUL bytes remain anywhere under docs/, and a regex sweep for markdown link openers with no `](` destination now reports zero hits across docs/content. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Author
|
GitHub cannot render a text diff for three of the five files: the old blob has a NUL byte inside git's 8000-byte binary-detection window, so they show as Each NUL byte is written as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Five documentation files contained literal NUL bytes (
0x00) that broke eight inline markdown links. In every case a placeholder of the form\0<index>\0sits exactly where the link destination](url)belongs, so the link renders as raw text:connectors/upstream/toolreference.mdget_started/about/about_defectdojo.mdget_started/contributing/how-to-write-a-parser.mdacunetix.mdexample pageget_started/contributing/documentation.mdhttp://localhost:1313issue_tracking/pro_integration/messaging_connectors.mdhttps://api.slack.com/appsThe NUL bytes had a second effect beyond the eight broken links, and it is the reason this went unnoticed:
grepreports each of these files asBinary file ... matchesand suppresses the matching lines, so the broken text never shows up in a search. For example,grep -rn "Snyk REST API"returned onlyBinary file ... matchesrather than the line.git diffis affected for three of the five — it renders them asBinary files differ— whiletoolreference.mdandhow-to-write-a-parser.mdstill diff as text because their first NUL byte falls past git's 8000-byte binary-detection window.Origin and how the destinations were recovered
All eight placeholders trace to a single commit, 1cafb09 (#15661). The pattern is consistent with a link-protecting pass that swaps each destination for a NUL-delimited sentinel, rewrites the surrounding prose, and restores the destinations afterwards — with the restore step dropping these eight. Indices are per-file counters (17, 18, 19, 22, 77, 389, 394, 395).
Nothing here is guessed. For each file, the last revision before #15661 still holds the intact text; it was located by walking that file's history and counting NUL bytes per revision until one came back clean. Every repaired line is byte-identical to its pre-#15661 counterpart, and all eight restored links turn out to be self-links (display text equals destination), which is a useful independent sanity check.
toolreference.mdhas a second corroborating source: its four translated siblings (.de,.es,.fr,.ja) were never touched by #15661 and carry the same markup. They agree with the parent revision on all three destinations. Those four files need no change — 0 NUL bytes each, links intact.Scope note
One pre-existing inconsistency was deliberately left alone, because it predates the corruption and appears identically in all five language files: the Snyk link text reads
/restwhile the destination points at/v1. The/restvalue is the one the docs instruct you to enter in the Location field, so only the decorative href is stale. Worth a follow-up, but changing it here would mean an unexplained edit sitting on top of an otherwise byte-exact restore.Test results
python -c "d=open('docs/content/connectors/upstream/toolreference.md','rb').read(); print(d.count(b'\0'))"→0docs/contain NUL bytes (images excluded).docs/contentfor markdown link openers whose next two characters are not](→ 0 hits, so the defect is fully enumerated rather than partially patched..gitattributes(*.md text eol=lf).grepnow reads all five files as text.validate_docs_buildworkflow; no local Hugo toolchain was used.Documentation
This PR is the documentation change.