From 1fe3a85cd446eda2e03275be5bcae695c0bf930d Mon Sep 17 00:00:00 2001 From: vinluo46 Date: Fri, 16 Jan 2026 11:41:20 +0800 Subject: [PATCH] Add instructions about JSON newline escaping to avoid common mistakes --- skills/json-canvas/SKILL.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/skills/json-canvas/SKILL.md b/skills/json-canvas/SKILL.md index e0611fe..0ddd0e4 100644 --- a/skills/json-canvas/SKILL.md +++ b/skills/json-canvas/SKILL.md @@ -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 |