You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/helper-functions.md
+39Lines changed: 39 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,45 @@ Hello, World!
37
37
─────────────
38
38
```
39
39
40
+
### `format_text`
41
+
42
+
Thu helper is designed to prepare plain or structured text for HTML or Markdown-like rendering. It does the following:
43
+
44
+
- Replaces line breaks (`\n`) in the input text with a custom line break string (like `<br/>` or an actual newline).
45
+
46
+
- Wraps inline code snippets—identified by delimiter pairs like <code>\`</code> or `'` — in `<code>` tags for HTML formatting (e.g., turning 'param' into `<code>param</code>`).
47
+
48
+
This helper is especially useful for formatting capability descriptions in web documentation, markdown previews, or any UI where readable line breaks and inline code styling are needed.
49
+
50
+
The `code_wrap_chars` parameter (last parameter of the helper function) defines pairs of characters that will wrap inline code blocks and get converted to <code>...</code> in the output.
51
+
52
+
You must pass a string made up of an even number of characters, where each two characters form one pair:
0 commit comments