Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/generation/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ fn gen_block_quote(block_quote: &BlockQuote, context: &mut Context) -> PrintItem
fn gen_code_block(code_block: &CodeBlock, context: &mut Context) -> PrintItems {
let mut items = PrintItems::new();
let code_text = get_code_text(code_block, context);
let code_text = utils::unindent(code_text.trim_end());
let code_text = code_text.trim_end();
let backtick_text = "`".repeat(get_backtick_count(&code_text));
let indent_level = if code_block.is_fenced { 0 } else { 4 };

Expand Down
10 changes: 10 additions & 0 deletions tests/specs/CodeBlocks/CodeBlocks_All.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,13 @@ other_formatted_77_formatted_80
```format ignore
other_formatted_77_formatted_80
```

!! Preserve leading spaces !!
```
one
```

[expect]
```
one
```
10 changes: 0 additions & 10 deletions tests/specs/Lists/Lists_All.txt
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,6 @@ Here is a paragraph

1. test

!! code block in list that is indented too much should unindent back !!
- List

Code block indented too much.

[expect]
- List

Code block indented too much.

!! html in list !!
- Testing this out.

Expand Down