Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions crates/biome_markdown_factory/src/generated/node_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 39 additions & 4 deletions crates/biome_markdown_factory/src/generated/syntax_factory.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::markdown::auxiliary::paragraph::FormatMdParagraphOptions;
use crate::prelude::*;
use crate::verbatim::format_verbatim_node;
use biome_formatter::write;
use biome_markdown_syntax::{MdHeader, MdHeaderFields};

Expand All @@ -8,11 +9,14 @@ pub(crate) struct FormatMdHeader;
impl FormatNodeRule<MdHeader> for FormatMdHeader {
fn fmt_fields(&self, node: &MdHeader, f: &mut MarkdownFormatter) -> FormatResult<()> {
let MdHeaderFields {
indent,
before,
content,
after,
} = node.as_fields();

write!(f, [format_verbatim_node(indent.syntax())])?;

write!(f, [before.format()])?;

if let Some(content) = content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ info: markdown/footnoteDefinition/long.md
- this is a long long long long long long long long long long long long long paragraph.
- this is a long long long long long long long long long long long long long paragraph.
+[^world]: this is a long long long long long long long long long long long long long paragraph.
+this is a long long long long long long long long long long long long long paragraph.
+ this is a long long long long long long long long long long long long long paragraph.
```

# Output

```md
[^hello]: this is a long long long long long long long long long long long long long paragraph.
[^world]: this is a long long long long long long long long long long long long long paragraph.
this is a long long long long long long long long long long long long long paragraph.
this is a long long long long long long long long long long long long long paragraph.
```

# Lines exceeding max width of 80 characters
```
1: [^hello]: this is a long long long long long long long long long long long long long paragraph.
2: [^world]: this is a long long long long long long long long long long long long long paragraph.
3: this is a long long long long long long long long long long long long long paragraph.
3: this is a long long long long long long long long long long long long long paragraph.
```
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ code fence
- \alpha
-$$
+ $$$
+\alpha
+$$$
+ \alpha
+ $$$

---

Expand Down Expand Up @@ -214,8 +214,8 @@ $$
---

$$$
\alpha
$$$
\alpha
$$$

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Foo
@@ -1,2 +1,2 @@
Foo
-\*\*\*
+***
+ ***
```

# Output

```md
Foo
***
***
```
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ info: markdown/spec/example-182.md
+++ Biome
@@ -1,2 +1,2 @@
-aaa
-bbb
+ aaa
bbb
+ bbb
```

# Output

```md
aaa
bbb
bbb
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
source: crates/biome_formatter_test/src/snapshot_builder.rs
info: markdown/spec/example-183.md
---

# Input

```md
aaa
bbb
ccc

```


# Prettier differences

```diff
--- Prettier
+++ Biome
@@ -1,3 +1,3 @@
aaa
-bbb
-ccc
+ bbb
+ ccc
```

# Output

```md
aaa
bbb
ccc
```
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@ info: markdown/spec/example-37.md
--- Prettier
+++ Biome
@@ -1,5 +1,3 @@
### foo
-### foo
-
## foo
-## foo
-
# foo
-# foo
+ ### foo
+ ## foo
+ # foo
```

# Output

```md
### foo
## foo
# foo
### foo
## foo
# foo
```
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ foo
@@ -1 +1,2 @@
-foo # bar
+foo
+# bar
+ # bar
```

# Output

```md
foo
# bar
# bar
```
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ info: markdown/spec/example-40.md
@@ -1,3 +1,2 @@
## foo
-
### bar
-### bar
+ ### bar
```

# Output

```md
## foo
### bar
### bar
```
Loading
Loading