Commit 5c02f9e
authored
Fix MDX lint URL false positives in prose (#79)
**Why**
Connector docs can contain ordinary prose such as “To sync (read)
data:”. The MDX validator was scanning all text nodes for dangerous URL
schemes, so that prose failed as if it were an actual data URL.
Connector repos should not need wording-only PRs to work around that
false positive.
**What this changes**
Narrows dangerous URL checks to URL-bearing markdown nodes and JSX
attributes. Plain text is no longer scanned as a URL, while links,
images, definitions, href/src/action attributes, and encoded dangerous
URL schemes remain blocked.
Adds a regression test for the Sentry-style Step content that triggered
the failure.
**Validation**
- npm test --prefix tools/mdx-lint
- patched validator accepts the current baton-sentry docs/connector.mdx
- patched validator still rejects an explicit data: markdown link
- git diff --check
**Rollout**
After merge, publish the updated reusable workflow ref used by connector
repos. They currently call ConductorOne/github-workflows at v4, so v4
must point at this fix before baton-sentry main stops using the old
validator.1 parent 0e8e52d commit 5c02f9e
2 files changed
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | 155 | | |
161 | 156 | | |
162 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
47 | 60 | | |
48 | 61 | | |
49 | 62 | | |
| |||
0 commit comments