mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-25 17:56:32 +00:00
Markdown writer: Fix regression in code blocks with attributes.
Code blocks with a single class but nonempty attributes were having attributes drop as a result of #7242. Closes #7397.
This commit is contained in:
@@ -256,10 +256,10 @@ noteToMarkdown opts num blocks = do
|
||||
then hang (writerTabStop opts) (marker <> spacer) contents
|
||||
else marker <> spacer <> contents
|
||||
|
||||
-- | (Code) blocks with a single class can just use it standalone,
|
||||
-- no need to bother with curly braces.
|
||||
-- | (Code) blocks with a single class and no attributes can just use it
|
||||
-- standalone, no need to bother with curly braces.
|
||||
classOrAttrsToMarkdown :: Attr -> Doc Text
|
||||
classOrAttrsToMarkdown ("",[cls],_) = literal cls
|
||||
classOrAttrsToMarkdown ("",[cls],[]) = literal cls
|
||||
classOrAttrsToMarkdown attrs = attrsToMarkdown attrs
|
||||
|
||||
-- | Ordered list start parser for use in Para below.
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
```
|
||||
% pandoc -t markdown
|
||||
~~~~ { .haskell startFrom="100"}
|
||||
qsort [] = []
|
||||
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
|
||||
qsort (filter (>= x) xs)
|
||||
~~~~
|
||||
^D
|
||||
``` {.haskell startFrom="100"}
|
||||
qsort [] = []
|
||||
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
|
||||
qsort (filter (>= x) xs)
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user