Commonmark/markua/gfm writers: avoid excessive indentation...
on bullet lists. They are now nested by 2 spaces instead of 4. See #8011.
This commit is contained in:
parent
813f3d5dd4
commit
356ece29cb
4 changed files with 16 additions and 16 deletions
|
@ -684,15 +684,15 @@ bulletListItemToMarkdown opts bs = do
|
|||
variant <- asks envVariant
|
||||
let exts = writerExtensions opts
|
||||
contents <- blockListToMarkdown opts $ taskListItemToAscii exts bs
|
||||
let sps = T.replicate (writerTabStop opts - 2) " "
|
||||
let start = case variant of
|
||||
Markua -> literal "* "
|
||||
_ -> literal $ "- " <> sps
|
||||
Markua -> "* "
|
||||
Commonmark -> "- "
|
||||
_ -> "- " <> T.replicate (writerTabStop opts - 2) " "
|
||||
-- remove trailing blank line if item ends with a tight list
|
||||
let contents' = if itemEndsWithTightList bs
|
||||
then chomp contents <> cr
|
||||
else contents
|
||||
return $ hang (writerTabStop opts) start contents'
|
||||
return $ hang (T.length start) (literal start) contents'
|
||||
|
||||
-- | Convert ordered list item (a list of blocks) to markdown.
|
||||
orderedListItemToMarkdown :: PandocMonad m
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</listitem>
|
||||
</itemizedlist>
|
||||
^D
|
||||
- [ ] a
|
||||
- [ ] a
|
||||
|
||||
- [x] b
|
||||
- [x] b
|
||||
```
|
||||
|
|
|
@ -217,6 +217,6 @@ hi
|
|||
- [ ] foo
|
||||
- [x] bar
|
||||
^D
|
||||
- [ ] foo
|
||||
- [x] bar
|
||||
- [ ] foo
|
||||
- [x] bar
|
||||
```
|
||||
|
|
|
@ -202,8 +202,8 @@ Multiple paragraphs:
|
|||
## Nested
|
||||
|
||||
* Tab
|
||||
* Tab
|
||||
* Tab
|
||||
* Tab
|
||||
|
||||
Here’s another:
|
||||
|
||||
|
@ -233,9 +233,9 @@ Same thing but with paragraphs:
|
|||
|
||||
* this is a list item indented with spaces
|
||||
|
||||
* this is an example list item indented with tabs
|
||||
* this is an example list item indented with tabs
|
||||
|
||||
* this is an example list item indented with spaces
|
||||
* this is an example list item indented with spaces
|
||||
|
||||
{id: fancy-list-markers}
|
||||
## Fancy list markers
|
||||
|
@ -492,17 +492,17 @@ Ellipses…and…and….
|
|||
* `p`$-Tree
|
||||
* Here’s some display math:
|
||||
|
||||
{format: latex}
|
||||
```
|
||||
\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}
|
||||
```
|
||||
{format: latex}
|
||||
```
|
||||
\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}
|
||||
```
|
||||
* Here’s one that has a line break in it: `\alpha + \omega \times x^2`$.
|
||||
|
||||
These shouldn’t be math:
|
||||
|
||||
* To get the famous equation, write `$e = mc^2$`.
|
||||
* $22,000 is a *lot* of money. So is $34,000. (It worked if "lot" is
|
||||
emphasized.)
|
||||
emphasized.)
|
||||
* Shoes ($20) and socks ($5).
|
||||
* Escaped `$`: $73 *this should be emphasized* 23$.
|
||||
|
||||
|
|
Loading…
Reference in a new issue