Plain writer: Support the four_space_rule extension. (#10813)

Allows using `-t plain+four_space_rule` to emulate the output of pandoc
before #7172. This is useful for users that use pandoc e.g. to
autoformat commit messages.
This commit is contained in:
Manolis Stamatogiannakis
2025-04-29 01:06:31 +02:00
committed by GitHub
parent 8e9d90504c
commit 7f9c776b97
2 changed files with 44 additions and 0 deletions
+3
View File
@@ -794,6 +794,9 @@ bulletListItemToMarkdown opts bs = do
Markdown
| isEnabled Ext_four_space_rule opts
-> "- " <> T.replicate (writerTabStop opts - 2) " "
PlainText
| isEnabled Ext_four_space_rule opts
-> "- " <> T.replicate (writerTabStop opts - 2) " "
_ -> "- "
-- remove trailing blank line if item ends with a tight list
let contents' = if itemEndsWithTightList bs
+41
View File
@@ -0,0 +1,41 @@
Check that the `four_space_rule` extension works for plain writer.
```
% pandoc -f markdown -t plain+four_space_rule
This is the title
Here we fix:
- a
- b
- c
^D
This is the title
Here we fix:
- a
- b
- c
```
Check that the `four_space_rule` extension is off by default.
```
% pandoc -f markdown -t plain
This is the title
Here we fix:
- a
- b
- c
^D
This is the title
Here we fix:
- a
- b
- c
```