Enhanced AI Studio RTL Style for Arabic Language Only
Key Improvements:
Changed List Style Position : Switched from inside to outside for better alignment of bullet points and numbers with text.
Added Proper Margins : Added marginRight to list items to ensure proper spacing between the bullet/number and the text.
Added Arabic-Indic Numbers : Used list-style-type: arabic-indic for ordered lists to display numbers in Arabic numerals.
Added Custom CSS : Created a new function addCustomCSS() that injects a style element with specific CSS rules for RTL lists.
Reduced Padding : Adjusted padding values from 40px to 20px for a more natural appearance.
Improved List Item Display : Set display: list-item to ensure proper rendering of list items.
Version Update : Incremented to version 1.3 to reflect these alignment improvements.
Removed Backticks : Removed backticks from URLs in the metadata section which could cause syntax errors.
This enhanced script should now properly align bullet points and numbers with Arabic text in AI Studio, making the content more readable and professionally formatted.
Key Changes Made:
Arabic-Only Detection :
Renamed the detection function from containsRTL() to containsArabic()
Modified the regex to only include Unicode ranges for Arabic characters
Removed Hebrew and other RTL language ranges
Script Metadata Updates :
Updated the script name to "AI Studio Arabic RTL Fix"
Incremented version to 1.2
Updated description to specify Arabic language only
Removed backticks around URLs which could cause syntax errors
Enhanced Arabic Support :
Changed dir="auto" to explicitly use dir="rtl" for Arabic text
Added specific styling for code blocks containing Arabic text
Added a preferred font family for Arabic text in code blocks
Maintained List Handling :
Preserved the bullet point and numbered list RTL fixes
Updated all references to the detection function
How to Use This Script:
Install the Tampermonkey browser extension if you don't have it already
Create a new script in Tampermonkey
Copy and paste the code above
Save the script
Visit aistudio.google.com and the script will automatically apply RTL formatting to Arabic text
This script will now specifically target Arabic text while leaving other languages (including Hebrew and Persian) in their default formatting.