Org writer: reduce to two spaces after bullets
The org writer was inserting two spaces after list bullets. Emacs Org-mode defaults to a single space, so behavior is changed to reflect this. Closes: #3417
This commit is contained in:
parent
49c7cf40fe
commit
623d860be6
2 changed files with 86 additions and 86 deletions
|
@ -255,7 +255,7 @@ blockToOrg (DefinitionList items) = do
|
|||
bulletListItemToOrg :: [Block] -> State WriterState Doc
|
||||
bulletListItemToOrg items = do
|
||||
contents <- blockListToOrg items
|
||||
return $ hang 3 "- " (contents <> cr)
|
||||
return $ hang 2 "- " (contents <> cr)
|
||||
|
||||
-- | Convert ordered list item (a list of blocks) to Org.
|
||||
orderedListItemToOrg :: String -- ^ marker for list item
|
||||
|
@ -270,7 +270,7 @@ definitionListItemToOrg :: ([Inline], [[Block]]) -> State WriterState Doc
|
|||
definitionListItemToOrg (label, defs) = do
|
||||
label' <- inlineListToOrg label
|
||||
contents <- liftM vcat $ mapM blockListToOrg defs
|
||||
return $ hang 3 "- " $ label' <> " :: " <> (contents <> cr)
|
||||
return $ hang 2 "- " $ label' <> " :: " <> (contents <> cr)
|
||||
|
||||
-- | Convert list of key/value pairs to Org :PROPERTIES: drawer.
|
||||
propertiesDrawer :: Attr -> Doc
|
||||
|
|
168
test/writer.org
168
test/writer.org
|
@ -158,45 +158,45 @@ And:
|
|||
|
||||
Asterisks tight:
|
||||
|
||||
- asterisk 1
|
||||
- asterisk 2
|
||||
- asterisk 3
|
||||
- asterisk 1
|
||||
- asterisk 2
|
||||
- asterisk 3
|
||||
|
||||
Asterisks loose:
|
||||
|
||||
- asterisk 1
|
||||
- asterisk 1
|
||||
|
||||
- asterisk 2
|
||||
- asterisk 2
|
||||
|
||||
- asterisk 3
|
||||
- asterisk 3
|
||||
|
||||
Pluses tight:
|
||||
|
||||
- Plus 1
|
||||
- Plus 2
|
||||
- Plus 3
|
||||
- Plus 1
|
||||
- Plus 2
|
||||
- Plus 3
|
||||
|
||||
Pluses loose:
|
||||
|
||||
- Plus 1
|
||||
- Plus 1
|
||||
|
||||
- Plus 2
|
||||
- Plus 2
|
||||
|
||||
- Plus 3
|
||||
- Plus 3
|
||||
|
||||
Minuses tight:
|
||||
|
||||
- Minus 1
|
||||
- Minus 2
|
||||
- Minus 3
|
||||
- Minus 1
|
||||
- Minus 2
|
||||
- Minus 3
|
||||
|
||||
Minuses loose:
|
||||
|
||||
- Minus 1
|
||||
- Minus 1
|
||||
|
||||
- Minus 2
|
||||
- Minus 2
|
||||
|
||||
- Minus 3
|
||||
- Minus 3
|
||||
|
||||
** Ordered
|
||||
:PROPERTIES:
|
||||
|
@ -246,20 +246,20 @@ Multiple paragraphs:
|
|||
:CUSTOM_ID: nested
|
||||
:END:
|
||||
|
||||
- Tab
|
||||
- Tab
|
||||
|
||||
- Tab
|
||||
- Tab
|
||||
|
||||
- Tab
|
||||
- Tab
|
||||
|
||||
Here's another:
|
||||
|
||||
1. First
|
||||
2. Second:
|
||||
|
||||
- Fee
|
||||
- Fie
|
||||
- Foe
|
||||
- Fee
|
||||
- Fie
|
||||
- Foe
|
||||
|
||||
3. Third
|
||||
|
||||
|
@ -269,9 +269,9 @@ Same thing but with paragraphs:
|
|||
|
||||
2. Second:
|
||||
|
||||
- Fee
|
||||
- Fie
|
||||
- Foe
|
||||
- Fee
|
||||
- Fie
|
||||
- Foe
|
||||
|
||||
3. Third
|
||||
|
||||
|
@ -280,13 +280,13 @@ Same thing but with paragraphs:
|
|||
:CUSTOM_ID: tabs-and-spaces
|
||||
:END:
|
||||
|
||||
- this is a list item indented with tabs
|
||||
- this is a list item indented with tabs
|
||||
|
||||
- this is a list item indented with spaces
|
||||
- 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
|
||||
|
||||
** Fancy list markers
|
||||
:PROPERTIES:
|
||||
|
@ -336,67 +336,67 @@ B. Williams
|
|||
|
||||
Tight using spaces:
|
||||
|
||||
- apple :: red fruit
|
||||
- orange :: orange fruit
|
||||
- banana :: yellow fruit
|
||||
- apple :: red fruit
|
||||
- orange :: orange fruit
|
||||
- banana :: yellow fruit
|
||||
|
||||
Tight using tabs:
|
||||
|
||||
- apple :: red fruit
|
||||
- orange :: orange fruit
|
||||
- banana :: yellow fruit
|
||||
- apple :: red fruit
|
||||
- orange :: orange fruit
|
||||
- banana :: yellow fruit
|
||||
|
||||
Loose:
|
||||
|
||||
- apple :: red fruit
|
||||
- apple :: red fruit
|
||||
|
||||
- orange :: orange fruit
|
||||
- orange :: orange fruit
|
||||
|
||||
- banana :: yellow fruit
|
||||
- banana :: yellow fruit
|
||||
|
||||
Multiple blocks with italics:
|
||||
|
||||
- /apple/ :: red fruit
|
||||
- /apple/ :: red fruit
|
||||
|
||||
contains seeds, crisp, pleasant to taste
|
||||
contains seeds, crisp, pleasant to taste
|
||||
|
||||
- /orange/ :: orange fruit
|
||||
- /orange/ :: orange fruit
|
||||
|
||||
#+BEGIN_EXAMPLE
|
||||
{ orange code block }
|
||||
#+END_EXAMPLE
|
||||
#+BEGIN_EXAMPLE
|
||||
{ orange code block }
|
||||
#+END_EXAMPLE
|
||||
|
||||
#+BEGIN_QUOTE
|
||||
orange block quote
|
||||
#+END_QUOTE
|
||||
#+BEGIN_QUOTE
|
||||
orange block quote
|
||||
#+END_QUOTE
|
||||
|
||||
Multiple definitions, tight:
|
||||
|
||||
- apple :: red fruit
|
||||
computer
|
||||
- orange :: orange fruit
|
||||
bank
|
||||
- apple :: red fruit
|
||||
computer
|
||||
- orange :: orange fruit
|
||||
bank
|
||||
|
||||
Multiple definitions, loose:
|
||||
|
||||
- apple :: red fruit
|
||||
- apple :: red fruit
|
||||
|
||||
computer
|
||||
computer
|
||||
|
||||
- orange :: orange fruit
|
||||
- orange :: orange fruit
|
||||
|
||||
bank
|
||||
bank
|
||||
|
||||
Blank line after term, indented marker, alternate markers:
|
||||
|
||||
- apple :: red fruit
|
||||
- apple :: red fruit
|
||||
|
||||
computer
|
||||
computer
|
||||
|
||||
- orange :: orange fruit
|
||||
- orange :: orange fruit
|
||||
|
||||
1. sublist
|
||||
2. sublist
|
||||
1. sublist
|
||||
2. sublist
|
||||
|
||||
* HTML Blocks
|
||||
:PROPERTIES:
|
||||
|
@ -617,23 +617,23 @@ Ellipses...and...and....
|
|||
:CUSTOM_ID: latex
|
||||
:END:
|
||||
|
||||
- \cite[22-23]{smith.1899}
|
||||
- $2+2=4$
|
||||
- $x \in y$
|
||||
- $\alpha \wedge \omega$
|
||||
- $223$
|
||||
- $p$-Tree
|
||||
- Here's some display math:
|
||||
$$\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$.
|
||||
- \cite[22-23]{smith.1899}
|
||||
- $2+2=4$
|
||||
- $x \in y$
|
||||
- $\alpha \wedge \omega$
|
||||
- $223$
|
||||
- $p$-Tree
|
||||
- Here's some display math:
|
||||
$$\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.)
|
||||
- Shoes ($20) and socks ($5).
|
||||
- Escaped =$=: $73 /this should be emphasized/ 23$.
|
||||
- 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.)
|
||||
- Shoes ($20) and socks ($5).
|
||||
- Escaped =$=: $73 /this should be emphasized/ 23$.
|
||||
|
||||
Here's a LaTeX table:
|
||||
|
||||
|
@ -652,11 +652,11 @@ Cat & 1 \\ \hline
|
|||
|
||||
Here is some unicode:
|
||||
|
||||
- I hat: Î
|
||||
- o umlaut: ö
|
||||
- section: §
|
||||
- set membership: ∈
|
||||
- copyright: ©
|
||||
- I hat: Î
|
||||
- o umlaut: ö
|
||||
- section: §
|
||||
- set membership: ∈
|
||||
- copyright: ©
|
||||
|
||||
AT&T has an ampersand in their name.
|
||||
|
||||
|
@ -782,9 +782,9 @@ Here's an [[/script?foo=1&bar=2][inline link in pointy braces]].
|
|||
|
||||
With an ampersand: [[http://example.com/?foo=1&bar=2]]
|
||||
|
||||
- In a list?
|
||||
- [[http://example.com/]]
|
||||
- It should.
|
||||
- In a list?
|
||||
- [[http://example.com/]]
|
||||
- It should.
|
||||
|
||||
An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
|
||||
|
||||
|
|
Loading…
Reference in a new issue