Skip to content

Commit

Permalink
RST writer: change bullet list hang from 3 to 2.
Browse files Browse the repository at this point in the history
This accords with the style in the reference docs.
  • Loading branch information
jgm committed Oct 1, 2024
1 parent 0dc6605 commit 4f15b03
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 92 deletions.
2 changes: 1 addition & 1 deletion src/Text/Pandoc/Writers/RST.hs
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ bulletListItemToRST items = do
let contents' = case items of
BlockQuote{}:_-> ".." $+$ contents
_ -> contents
return $ hang 3 "- " contents' $$
return $ hang 2 "- " contents' $$
if null items || (endsWithPlain items && not (endsWithList items))
then cr
else blankline
Expand Down
4 changes: 2 additions & 2 deletions test/Tests/Writers/RST.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tests :: [TestTree]
tests = [ testGroup "rubrics"
[ "in list item" =:
bulletList [header 2 (text "foo")] =?>
"- .. rubric:: foo"
"- .. rubric:: foo"
, "in definition list item" =:
definitionList [(text "foo", [header 2 (text "bar"),
para $ text "baz"])] =?>
Expand Down Expand Up @@ -60,7 +60,7 @@ tests = [ testGroup "rubrics"
[ "a list is closed by a comment before a quote" =: -- issue 4248
bulletList [plain "bulleted"] <> blockQuote (plain "quoted") =?>
unlines
[ "- bulleted"
[ "- bulleted"
, ""
, ".."
, ""
Expand Down
12 changes: 6 additions & 6 deletions test/command/10236.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
>
> para 2
^D
- ..
- ..
test
test
para 2
para 2
```

```
Expand Down Expand Up @@ -71,10 +71,10 @@
.. list-table::
:widths: 19
* - ..
* - ..
*Level 0:*
*Level 0:*
*Incomplete process*
*Incomplete process*
```

24 changes: 12 additions & 12 deletions test/command/4564.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
:widths: 11 10 12 27
:header-rows: 1
* - Centered Header
- Left Aligned
- Right Aligned
- Default aligned
* - First
-
- 12.0
- Example of a row that spans multiple lines.
* - Second
- row
- 5.0
- Here’s another one. Note the blank line between rows.
* - Centered Header
- Left Aligned
- Right Aligned
- Default aligned
* - First
-
- 12.0
- Example of a row that spans multiple lines.
* - Second
- row
- 5.0
- Here’s another one. Note the blank line between rows.
```
14 changes: 7 additions & 7 deletions test/command/5898.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
</body>
</html>
^D
- A list of stuff with a table inside
- A list of stuff with a table inside
===== ====== =====
First Second Third
===== ====== =====
First Second Third
===== ====== =====
===== ====== =====
First Second Third
===== ====== =====
First Second Third
===== ====== =====
- Another list item
- Another list item
```
22 changes: 11 additions & 11 deletions test/command/5899.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@
</body>
</html>
^D
- A list of stuff with a table inside
- A list of stuff with a table inside
+-------+----------------------------------------------------+-------+
| First | Second | Third |
+=======+====================================================+=======+
| First | The big long table cell. The big long table cell. | Third |
| | The big long table cell. The big long table cell. | |
| | The big long table cell. The big long table cell. | |
| | The big long table cell. The big long table cell. | |
| | The big long table cell. The big long table cell. | |
+-------+----------------------------------------------------+-------+
+-------+----------------------------------------------------+-------+
| First | Second | Third |
+=======+====================================================+=======+
| First | The big long table cell. The big long table cell. | Third |
| | The big long table cell. The big long table cell. | |
| | The big long table cell. The big long table cell. | |
| | The big long table cell. The big long table cell. | |
| | The big long table cell. The big long table cell. | |
+-------+----------------------------------------------------+-------+
- Another list item
- Another list item
```
106 changes: 53 additions & 53 deletions test/writer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,45 +133,45 @@ Unordered

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
-------
Expand Down Expand Up @@ -217,20 +217,20 @@ Multiple paragraphs:
Nested
------

- Tab
- Tab

- Tab
- Tab

- Tab
- Tab

Here’s another:

1. First
2. Second:

- Fee
- Fie
- Foe
- Fee
- Fie
- Foe

3. Third

Expand All @@ -240,22 +240,22 @@ Same thing but with paragraphs:

2. Second:

- Fee
- Fie
- Foe
- Fee
- Fie
- Foe

3. Third

Tabs and spaces
---------------

- 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
------------------
Expand Down Expand Up @@ -610,24 +610,24 @@ Ellipses…and…and….
LaTeX
=====

- :raw-latex:`\cite[22-23]{smith.1899}`
- :math:`2+2=4`
- :math:`x \in y`
- :math:`\alpha \wedge \omega`
- :math:`223`
- :math:`p`-Tree
- Here’s some display math:
- :raw-latex:`\cite[22-23]{smith.1899}`
- :math:`2+2=4`
- :math:`x \in y`
- :math:`\alpha \wedge \omega`
- :math:`223`
- :math:`p`-Tree
- Here’s some display math:

.. 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: :math:`\alpha + \omega \times x^2`.
.. 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: :math:`\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:

Expand All @@ -646,11 +646,11 @@ Special Characters

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.

Expand Down Expand Up @@ -762,9 +762,9 @@ Autolinks

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: [email protected]

Expand Down

0 comments on commit 4f15b03

Please sign in to comment.