-
Notifications
You must be signed in to change notification settings - Fork 5
fix: force LTR direction and layout for code elements in RTL/Arabic l… #141 #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -422,7 +422,7 @@ export default function CodeWorkspace({ | |
|
|
||
| {/* Body */} | ||
| {mode === "snippet" ? ( | ||
| <div className="relative flex flex-1 overflow-hidden font-mono text-[13px] leading-[1.7]"> | ||
| <div dir="ltr" className="relative flex flex-1 overflow-hidden font-mono text-[13px] leading-[1.7]"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win This only fixes snippet mode; project file paths still render under RTL. The uploaded path list below ( 🤖 Prompt for AI Agents |
||
| <div | ||
| ref={gutterRef} | ||
| aria-hidden="true" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Avoid emitting
nonce="undefined"here.nonceis optional in this layout, but string interpolation always writes an attribute. Ifx-nonceis ever missing, this becomesnonce="undefined"and the bootstrap script no longer satisfies CSP. Render a real<script>node and passnonce={nonce}so the attribute is omitted when absent.Suggested fix
📝 Committable suggestion
🧰 Tools
🪛 ast-grep (0.44.0)
[warning] 56-56: Usage of dangerouslySetInnerHTML detected. This bypasses React's built-in XSS protection. Always sanitize HTML content using libraries like DOMPurify before injecting it into the DOM to prevent XSS attacks.
Context: dangerouslySetInnerHTML
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation
(react-unsafe-html-injection)
🪛 React Doctor (0.5.8)
[error] 57-57:
dangerouslySetInnerHTMLis an XSS hole that runs attacker-controlled HTML in your users' browsers.Render trusted content as React children so attacker-controlled HTML cannot run in users' browsers.
(no-danger)
🤖 Prompt for AI Agents