Skip to content

Commit

Permalink
Asciidoc writer: preserve original base level.
Browse files Browse the repository at this point in the history
We used to normalize so that the base level is always 1, but
asciidoc no longer seems to care about that, and the behavior
creates difficulties when we are converting fragments.

Closes #10062.
  • Loading branch information
jgm committed Aug 7, 2024
1 parent 5967d7a commit 1f093ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Text/Pandoc/Writers/AsciiDoc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pandocToAsciiDoc opts (Pandoc meta blocks) = do
(blockListToAsciiDoc opts)
(fmap chomp . inlineListToAsciiDoc opts)
meta
main <- blockListToAsciiDoc opts $ makeSections False (Just 1) blocks
main <- blockListToAsciiDoc opts $ makeSections False Nothing blocks
st <- get
let context = defField "body" main
$ defField "toc"
Expand Down
10 changes: 10 additions & 0 deletions test/command/10062.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
```
% pandoc -t asciidoc
### section
##### five
^D
==== section
====== five
```

0 comments on commit 1f093ea

Please sign in to comment.