Smart Input
The web editor includes several smart input features that automatically handle common tasks, so you can focus on writing your story.
Smart Dash: - to -> β
When you type - at the beginning of a line in the node body, it is automatically expanded to -> (option arrow with a space). This saves keystrokes when creating choice options.
Example:
You type:
-
The editor inserts:
->
You can then continue typing the option text:
-> Go to the forest
Smart dash only activates at the start of a new line in the body of a node (after ---), and only when the previous line is not a separator. It will not trigger in headers or after ===.
Auto-Replace: $ and :β
The editor automatically replaces special characters that have syntax meaning in Yarn with their safe equivalents.
Dollar Sign $ to [usd/]β
In message text, the $ character is used for variables ($name). If you want a literal dollar sign (for example, in a price), just type $ and the editor replaces it with [usd/].
Example:
You type:
The item costs $
The editor produces:
The item costs [usd/]
In the game, the user sees:
The item costs $
If the $ is followed by a letter or underscore (like $name), the editor does not replace it β this is treated as a variable reference.
Colon : to [cl/]β
The first colon on a line is used as a speaker separator (Anna: Hello!). If you need a second colon in the same line, the editor automatically replaces it with [cl/].
Example:
You type:
Anna: The time is 12:
The editor produces:
Anna: The time is 12[cl/]
In the game, the user sees:
Anna:
The time is 12:
The first colon on a line is never auto-replaced β it defines the speaker name. Only subsequent colons are converted.
Auto-Escape Special Charactersβ
Characters that have special meaning in Yarn syntax are automatically escaped with \ when typed in message text:
| Character | Escaped as | Meaning in Yarn |
|---|---|---|
[ | \[ | Opens a tag |
] | \] | Closes a tag |
< | \< | Opens a command |
> | \> | Closes a command |
{ | \{ | Opens variable interpolation |
} | \} | Closes variable interpolation |
# | \# | Line tag |
/ | \/ | Used in closing tags |
Example:
You type in a message line:
Press the [Enter] key
The editor produces:
Press the \[Enter\] key
Auto-escaping does not activate:
- At the beginning of a line (allows
[photo=...]and<<commands>>) - Inside existing syntax blocks (
<< >>,[ ],{ }) - When the character is already preceded by
\
Smart Enterβ
Pressing Enter in a message line behaves differently from a normal text editor:
First Enter: Insert [br/]β
The first time you press Enter in a message, a [br/] tag is inserted instead of a line break. This creates a line break within the same Telegram message.
Example:
You type:
First line
Press Enter:
First line[br/]
Continue typing:
First line[br/]Second line
In the game, the user sees one message:
First line
Second line
Second Enter: New Lineβ
If you press Enter again right after [br/], the tag is removed and a real newline is inserted. This starts a new message.
Example:
After typing First line[br/], press Enter again:
First line
The cursor moves to the next line, and the new line becomes a separate message.
Ctrl/Cmd + Enter: Always New Lineβ
Press Ctrl+Enter (or Cmd+Enter on macOS) to always insert a real line break, skipping the [br/] behavior.
| Action | Result |
|---|---|
Enter (first) | Inserts [br/] (line break within message) |
Enter (second, after [br/]) | Removes [br/], inserts new line (new message) |
Ctrl/Cmd + Enter | Always inserts new line (new message) |