Add instructions about JSON newline escaping to avoid common mistakes

This commit is contained in:
vinluo46
2026-01-16 11:41:20 +08:00
parent 4540df83fc
commit 1fe3a85cd4
+14
View File
@@ -69,6 +69,20 @@ Text nodes contain Markdown content.
}
```
#### Newline Escaping (Common Pitfall)
In JSON, newline characters inside strings **must** be represented as `\n`. Do **not** use the literal sequence `\\n` in a `.canvas` file—Obsidian will render it as the characters `\` and `n` instead of a line break.
Examples:
```json
{ "type": "text", "text": "Line 1\nLine 2" }
```
```json
{ "type": "text", "text": "Line 1\\nLine 2" }
```
| Attribute | Required | Type | Description |
|-----------|----------|------|-------------|
| `text` | Yes | string | Plain text with Markdown syntax |