Skip to content

comark/magic-move/content-in-magic-move

Put only code blocks in ::magic-move

Every block inside ::magic-move is one step of the code, so only code blocks go there. Anything else, such as a paragraph explaining a step, is dropped. Name each step with a label after the fence's language instead, or move the text above or below the block.

Incorrect

Step 1
const total = price * 2
ts
Step 2
const rate = 2
const total = price * rate
ts
::magic-move
```ts
const total = price * 2
```

Pull the rate out into a constant.

```ts
const rate = 2
const total = price * rate
```
::
md

Correct

Start
const total = price * 2
ts
Pull the rate out into a constant
const rate = 2
const total = price * rate
ts
::magic-move
```ts [Start]
const total = price * 2
```

```ts [Pull the rate out into a constant]
const rate = 2
const total = price * rate
```
::
md