tessl install tessl/pypi-python-bidi@0.6.0Python Bidi layout wrapping the Rust crate unicode-bidi
Agent Success
Agent success rate when using this tile
93%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.09x
Baseline
Agent success rate without this tile
85%
A utility that processes mixed left-to-right (LTR) and right-to-left (RTL) text in code comments, ensuring proper visual display for documentation generators and IDE preview panes.
Process text containing mathematical operations alongside RTL text, ensuring both the mathematical operators and RTL content display correctly.
Process text with quoted content that may contain nested punctuation or parenthetical information in RTL context.
Handle text with embedded directional formatting to create explicit left-to-right or right-to-left regions within larger text blocks.
@generates
def format_comment(text: str, *, use_uppercase_as_rtl: bool = False) -> str:
"""
Format bidirectional text for display in documentation and IDEs.
Args:
text: The text to format containing mixed LTR/RTL content
use_uppercase_as_rtl: Debug mode to treat uppercase as RTL (for testing)
Returns:
Formatted text with proper bidirectional ordering for visual display
"""
passProvides bidirectional text algorithm implementation for proper text reordering.
@satisfied-by