Skip to content

[CommonMark] Leading/trailing newlines are stripped in the value of fenced codeblock #351

@ikatyang

Description

@ikatyang

Subject of the issue

commonmark: true

```


123


```

Steps to reproduce

astexplorer

Expected behaviour

Same as CommonMark playground:

{
  "type": "code",
  "lang": null,
  "value": "\n\n123\n\n"
}

Actual behaviour

 {
   "type": "code",
   "lang": null,
-  "value": "\n\n123\n\n"
+  "value": "123"
 }

Original post: prettier/prettier#5037

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions