Add agentic workflows example to AI getting started guide - #9
Merged
Conversation
3 tasks
5 tasks
kojiwakayama
added a commit
that referenced
this pull request
Sep 3, 2026
Supplying `urlTransform` replaces react-markdown's `defaultUrlTransform`, so `sanitizeUrl` is the only scheme guard left in a scaffolded chat app. It anchored both regexes at offset 0 over the raw string, but browsers ignore ASCII spaces and control characters while parsing a URL: a destination written as `[x](java	script:alert(1))` reaches the renderer as `java\tscript:alert(1)`, matches neither regex, and still navigates to `javascript:` when clicked. ` data:text/html,...` and a leading control character bypass it the same way. Match against a copy with those characters removed so an obfuscated scheme fails closed. The `img` override also emitted an anchor. Markdown allows a linked image (`[](href)`), which react-markdown renders through the `a` override, so that anchor nested inside another one - invalid HTML the browser repairs into a different tree than React rendered, which mismatches on hydration. Render inert text carrying the source in `title` instead; the surrounding link, when there is one, still works. templates/index.test.ts now runs the policy rather than grepping for it: it lifts `sanitizeUrl` out of each scaffolded renderer and asserts the obfuscated schemes are dropped and ordinary URLs survive. Each of the four bypasses above fails against the previous implementation. It also asserts the `img` override emits no anchor. Sonar's duplication gate reported 85.3% duplicated new lines because the five chat starters scaffold the same `app/markdown-renderer.tsx`. That parity is structural: every starter is copied verbatim into a generated project, so one starter's file cannot import a module from a sibling. Exclude `templates/files/**` from CPD, alongside the test-fixture exclusions added for the same reason in #4284. The files stay in `sonar.sources`, so their bugs, smells, and security issues are still reported. Claude-Session: https://claude.ai/code/session_01QfWNMiUhvWMKWi6BGfVdY3
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
Testing
Codex Task