detect_text_direction
Detect whether mixed Persian/English text is RTL or LTR and optionally wrap usernames, product names, or strings with bidi-safe Unicode isolates or HTML tags to prevent display issues.
Instructions
Detect text direction (first-strong and dominant script, mixed flag) and optionally wrap the text bidi-safely: Unicode isolates (FSI/RLI/LRI) or HTML / dir=auto. Use for usernames, product names and mixed Persian/English strings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| wrap | No |