# POST /v1/wrap

Part of the HebrewCore documentation. Web: https://hc.itsbaba.com/docs#wrap · Whole docs: https://hc.itsbaba.com/docs.md · Index: https://hc.itsbaba.com/llms.txt

`POST /v1/wrap`

Render-ready bidirectional output for a display line. Every left-to-right unit (a Latin term, a price, a number with its unit, a range such as "10–20%", a date, a percentage, a comparison such as "<5") is kept whole and in order, so no digit, range or sign is ever reversed or mirrored. Deterministic, no model.

| Parameter | Type | Description |
| --- | --- | --- |
| `text` *required* | string | The display line, up to 20,000 characters. |
| `format` | enum | `html` (default, for the web, React and webviews): a `<span dir>` for the line and one per unit. `isolate`: Unicode isolates, for modern text engines (iOS, Android 7+, current browsers). `marks`: direction marks (LRM/RLM), which render correctly on every engine, including older Android and embedded displays. |
| `base` | enum | Paragraph direction of the surface: `auto` (default, first strong letter), `rtl` or `ltr`. Pass `rtl` for a Hebrew line even when it starts with a Latin term; `isolate` and `marks` output then starts with a mark so a text view takes the right direction by itself. |

```http
POST /v1/wrap   { "text": "הנחה: 10–20% על Galaxy S25 עד 31/12", "format": "html", "base": "rtl" }

{
  "dir": "rtl",
  "format": "html",
  "output": "<span dir=\"rtl\">הנחה: <span dir=\"ltr\" lang=\"und\">10–20%</span> על <span dir=\"ltr\" lang=\"en\">Galaxy S25</span> עד <span dir=\"ltr\" lang=\"und\">31/12</span></span>",
  "runs": [ … ]
}
```
