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 :: [Block] -> State WriterState Doc
|
||||||
bulletListItemToOrg items = do
|
bulletListItemToOrg items = do
|
||||||
contents <- blockListToOrg items
|
contents <- blockListToOrg items
|
||||||
return $ hang 3 "- " (contents <> cr)
|
return $ hang 2 "- " (contents <> cr)
|
||||||
|
|
||||||
-- | Convert ordered list item (a list of blocks) to Org.
|
-- | Convert ordered list item (a list of blocks) to Org.
|
||||||
orderedListItemToOrg :: String -- ^ marker for list item
|
orderedListItemToOrg :: String -- ^ marker for list item
|
||||||
|
@ -270,7 +270,7 @@ definitionListItemToOrg :: ([Inline], [[Block]]) -> State WriterState Doc
|
||||||
definitionListItemToOrg (label, defs) = do
|
definitionListItemToOrg (label, defs) = do
|
||||||
label' <- inlineListToOrg label
|
label' <- inlineListToOrg label
|
||||||
contents <- liftM vcat $ mapM blockListToOrg defs
|
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.
|
-- | Convert list of key/value pairs to Org :PROPERTIES: drawer.
|
||||||
propertiesDrawer :: Attr -> Doc
|
propertiesDrawer :: Attr -> Doc
|
||||||
|
|
168
test/writer.org
168
test/writer.org
|
@ -158,45 +158,45 @@ And:
|
||||||
|
|
||||||
Asterisks tight:
|
Asterisks tight:
|
||||||
|
|
||||||
- asterisk 1
|
- asterisk 1
|
||||||
- asterisk 2
|
- asterisk 2
|
||||||
- asterisk 3
|
- asterisk 3
|
||||||
|
|
||||||
Asterisks loose:
|
Asterisks loose:
|
||||||
|
|
||||||
- asterisk 1
|
- asterisk 1
|
||||||
|
|
||||||
- asterisk 2
|
- asterisk 2
|
||||||
|
|
||||||
- asterisk 3
|
- asterisk 3
|
||||||
|
|
||||||
Pluses tight:
|
Pluses tight:
|
||||||
|
|
||||||
- Plus 1
|
- Plus 1
|
||||||
- Plus 2
|
- Plus 2
|
||||||
- Plus 3
|
- Plus 3
|
||||||
|
|
||||||
Pluses loose:
|
Pluses loose:
|
||||||
|
|
||||||
- Plus 1
|
- Plus 1
|
||||||
|
|
||||||
- Plus 2
|
- Plus 2
|
||||||
|
|
||||||
- Plus 3
|
- Plus 3
|
||||||
|
|
||||||
Minuses tight:
|
Minuses tight:
|
||||||
|
|
||||||
- Minus 1
|
- Minus 1
|
||||||
- Minus 2
|
- Minus 2
|
||||||
- Minus 3
|
- Minus 3
|
||||||
|
|
||||||
Minuses loose:
|
Minuses loose:
|
||||||
|
|
||||||
- Minus 1
|
- Minus 1
|
||||||
|
|
||||||
- Minus 2
|
- Minus 2
|
||||||
|
|
||||||
- Minus 3
|
- Minus 3
|
||||||
|
|
||||||
** Ordered
|
** Ordered
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
@ -246,20 +246,20 @@ Multiple paragraphs:
|
||||||
:CUSTOM_ID: nested
|
:CUSTOM_ID: nested
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
- Tab
|
- Tab
|
||||||
|
|
||||||
- Tab
|
- Tab
|
||||||
|
|
||||||
- Tab
|
- Tab
|
||||||
|
|
||||||
Here's another:
|
Here's another:
|
||||||
|
|
||||||
1. First
|
1. First
|
||||||
2. Second:
|
2. Second:
|
||||||
|
|
||||||
- Fee
|
- Fee
|
||||||
- Fie
|
- Fie
|
||||||
- Foe
|
- Foe
|
||||||
|
|
||||||
3. Third
|
3. Third
|
||||||
|
|
||||||
|
@ -269,9 +269,9 @@ Same thing but with paragraphs:
|
||||||
|
|
||||||
2. Second:
|
2. Second:
|
||||||
|
|
||||||
- Fee
|
- Fee
|
||||||
- Fie
|
- Fie
|
||||||
- Foe
|
- Foe
|
||||||
|
|
||||||
3. Third
|
3. Third
|
||||||
|
|
||||||
|
@ -280,13 +280,13 @@ Same thing but with paragraphs:
|
||||||
:CUSTOM_ID: tabs-and-spaces
|
:CUSTOM_ID: tabs-and-spaces
|
||||||
:END:
|
: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
|
** Fancy list markers
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
@ -336,67 +336,67 @@ B. Williams
|
||||||
|
|
||||||
Tight using spaces:
|
Tight using spaces:
|
||||||
|
|
||||||
- apple :: red fruit
|
- apple :: red fruit
|
||||||
- orange :: orange fruit
|
- orange :: orange fruit
|
||||||
- banana :: yellow fruit
|
- banana :: yellow fruit
|
||||||
|
|
||||||
Tight using tabs:
|
Tight using tabs:
|
||||||
|
|
||||||
- apple :: red fruit
|
- apple :: red fruit
|
||||||
- orange :: orange fruit
|
- orange :: orange fruit
|
||||||
- banana :: yellow fruit
|
- banana :: yellow fruit
|
||||||
|
|
||||||
Loose:
|
Loose:
|
||||||
|
|
||||||
- apple :: red fruit
|
- apple :: red fruit
|
||||||
|
|
||||||
- orange :: orange fruit
|
- orange :: orange fruit
|
||||||
|
|
||||||
- banana :: yellow fruit
|
- banana :: yellow fruit
|
||||||
|
|
||||||
Multiple blocks with italics:
|
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
|
#+BEGIN_EXAMPLE
|
||||||
{ orange code block }
|
{ orange code block }
|
||||||
#+END_EXAMPLE
|
#+END_EXAMPLE
|
||||||
|
|
||||||
#+BEGIN_QUOTE
|
#+BEGIN_QUOTE
|
||||||
orange block quote
|
orange block quote
|
||||||
#+END_QUOTE
|
#+END_QUOTE
|
||||||
|
|
||||||
Multiple definitions, tight:
|
Multiple definitions, tight:
|
||||||
|
|
||||||
- apple :: red fruit
|
- apple :: red fruit
|
||||||
computer
|
computer
|
||||||
- orange :: orange fruit
|
- orange :: orange fruit
|
||||||
bank
|
bank
|
||||||
|
|
||||||
Multiple definitions, loose:
|
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:
|
Blank line after term, indented marker, alternate markers:
|
||||||
|
|
||||||
- apple :: red fruit
|
- apple :: red fruit
|
||||||
|
|
||||||
computer
|
computer
|
||||||
|
|
||||||
- orange :: orange fruit
|
- orange :: orange fruit
|
||||||
|
|
||||||
1. sublist
|
1. sublist
|
||||||
2. sublist
|
2. sublist
|
||||||
|
|
||||||
* HTML Blocks
|
* HTML Blocks
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
@ -617,23 +617,23 @@ Ellipses...and...and....
|
||||||
:CUSTOM_ID: latex
|
:CUSTOM_ID: latex
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
- \cite[22-23]{smith.1899}
|
- \cite[22-23]{smith.1899}
|
||||||
- $2+2=4$
|
- $2+2=4$
|
||||||
- $x \in y$
|
- $x \in y$
|
||||||
- $\alpha \wedge \omega$
|
- $\alpha \wedge \omega$
|
||||||
- $223$
|
- $223$
|
||||||
- $p$-Tree
|
- $p$-Tree
|
||||||
- Here's some display math:
|
- Here's some display math:
|
||||||
$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$
|
$$\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$.
|
- Here's one that has a line break in it: $\alpha + \omega \times x^2$.
|
||||||
|
|
||||||
These shouldn't be math:
|
These shouldn't be math:
|
||||||
|
|
||||||
- To get the famous equation, write =$e = mc^2$=.
|
- 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
|
- $22,000 is a /lot/ of money. So is $34,000. (It worked if "lot" is
|
||||||
emphasized.)
|
emphasized.)
|
||||||
- Shoes ($20) and socks ($5).
|
- Shoes ($20) and socks ($5).
|
||||||
- Escaped =$=: $73 /this should be emphasized/ 23$.
|
- Escaped =$=: $73 /this should be emphasized/ 23$.
|
||||||
|
|
||||||
Here's a LaTeX table:
|
Here's a LaTeX table:
|
||||||
|
|
||||||
|
@ -652,11 +652,11 @@ Cat & 1 \\ \hline
|
||||||
|
|
||||||
Here is some unicode:
|
Here is some unicode:
|
||||||
|
|
||||||
- I hat: Î
|
- I hat: Î
|
||||||
- o umlaut: ö
|
- o umlaut: ö
|
||||||
- section: §
|
- section: §
|
||||||
- set membership: ∈
|
- set membership: ∈
|
||||||
- copyright: ©
|
- copyright: ©
|
||||||
|
|
||||||
AT&T has an ampersand in their name.
|
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]]
|
With an ampersand: [[http://example.com/?foo=1&bar=2]]
|
||||||
|
|
||||||
- In a list?
|
- In a list?
|
||||||
- [[http://example.com/]]
|
- [[http://example.com/]]
|
||||||
- It should.
|
- It should.
|
||||||
|
|
||||||
An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
|
An e-mail address: [[mailto:nobody@nowhere.net][nobody@nowhere.net]]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue