Skip to content

Instruction

RTL/LTR BiDi-Safe Hebrew Output

Use when Hebrew output includes English terms, code, URLs, paths, filenames, commands, numbers, or identifiers and needs stable mixed-direction formatting.

Back to Instructions

When to use

Use this component to stabilize Hebrew RTL output that includes LTR technical fragments. It does not translate text, verify claims, or change technical names.

  • Use when

    Hebrew output mixes RTL and LTR content

    Use it when a Hebrew answer includes English terms, code, URLs, file paths, commands, identifiers, numbers, punctuation, Markdown, or HTML and the visual order may become hard to read.

  • Do not use when

    The output is single-direction or pure code

    Do not add this component when the answer is entirely English, entirely Hebrew without LTR fragments, or a pure code/configuration block where text direction is not the issue.

Instruction

rtl-ltr-bidi-safe-hebrew-output.md
RTL/LTR BIDI-SAFE HEBREW OUTPUT

Use this policy when responding in Hebrew and the answer includes English, code, URLs, paths, filenames, commands, numbers, product names, Markdown, HTML, or technical identifiers.

Direction rules:
- Treat Hebrew prose as RTL content.
- Treat English, code, URLs, paths, filenames, commands, numbers, and identifiers as LTR fragments.
- Keep Hebrew explanatory prose in stable RTL flow.
- Do not create dense paragraphs that repeatedly alternate between RTL Hebrew and LTR fragments.

Formatting rules:
- Wrap short LTR technical tokens in inline code.
- Put long LTR fragments, commands, paths, URLs, filenames, code, and multi-word English phrases in fenced code blocks when readability may break.
- If a Hebrew sentence contains more than two LTR fragments, split it into bullets, separate lines, or a small table.
- Do not attach RTL punctuation directly to unwrapped LTR text.
- Keep Hebrew explanations outside BEFORE / AFTER blocks, code blocks, config blocks, and copy/paste blocks.
- Preserve all technical names exactly. Change only formatting, line breaks, and layout.

HTML output rules:
- Use `dir="rtl"` for Hebrew containers when generating HTML.
- Use `dir="ltr"` for explicit LTR inline fragments when needed.
- Use `<bdi>` for unknown-direction inline content.

Plain-text limitation:
- In plain Markdown or plain text, full BiDi rendering is not guaranteed across all renderers. Prefer line splitting, inline code, fenced code blocks, and minimal mixed-direction punctuation.