fix(markdown): NESTED_QUOTES skips flow-sequence arrays of quoted strings (closes #529)#535
Open
mayazbay wants to merge 1 commit into
Open
Conversation
Closes garrytan#529. Detector counted unescaped double-quotes per line. Flow-sequence arrays like `related: ["LAW-001", "LAW-009"]` legitimately have 4+ quotes because each item is independently quoted. This triggered FP NESTED_QUOTES on valid YAML. Genuine "nested quote" pattern is a SINGLE value with inner unescaped quotes (`title: "a "b" c"`), not a flow-array of separately-quoted items. Skip lines where value starts with `[` and ends with `]`. 3 regression tests added: - flow-array of quoted IDs (closes garrytan#529) - flow-array of quoted wikilinks (closes garrytan#529) - inline genuine nested-quote on single value still triggers (no false-negative) All 22 markdown-validation tests pass.
1 task
Author
|
@garrytan polite ping — this is a one-line skip-condition + 3 regression tests, would close my production wiki's last |
1 task
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.
Summary
Closes #529.
The
NESTED_QUOTESlint check counts unescaped double-quotes per line. This produces false-positives on legitimate YAML flow-sequence arrays of quoted strings:This line has 6 unescaped double quotes, but each is part of an independently-quoted item — the YAML is valid and parses correctly. The check fired anyway because per-line quote-counting is the wrong primitive for flow-arrays.
Fix
Skip lines where the value starts with
[and ends with]. Genuine nested-quote pattern is a SINGLE value containing inner unescaped quotes (title: "He said "hello" loudly"), which is what the check was originally designed for.Tests
Added 3 regression tests in
test/markdown-validation.test.ts:["LAW-001", "LAW-009"]) — must NOT trigger["[[skill-a]]", "[[skill-b]]"]) — must NOT triggertitle: "a "b" c") — must STILL trigger (no false-negative)bun test test/markdown-validation.test.ts→ 22/22 pass.Impact
On the Nous AGaaS production wiki (2533 pages, gbrain v0.22.16):
related: ["[[X]]"]syntaxHealth 100/100without rewriting valid YAMLAfter this fix: 0 NESTED_QUOTES findings on the same brain.
Related
graph_coveragefor markdown-only brains, separate PR coming.Need help on this PR? Tag
@codesmithwith what you need.