Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The fancy_lists extension doesn't work with gfm #10667

Open
bkarpati opened this issue Mar 6, 2025 · 2 comments
Open

The fancy_lists extension doesn't work with gfm #10667

bkarpati opened this issue Mar 6, 2025 · 2 comments
Labels

Comments

@bkarpati
Copy link

bkarpati commented Mar 6, 2025

Explain the problem.
Include the exact command line you used and all inputs necessary to reproduce the issue. Please create as minimal an example as possible, to help the maintainers isolate the problem. Explain the output you received and how it differs from what you expected.

Using the latest v3.6.3 of pandoc, fancy_lists is reported as a supported extension for the gfm format that is off by default. However, even after enabling it, it does not seem to have any effect on the output.

With the following source document

## Fancy list test

#. Item 1
#. Item 2
#. Item 3

And running the following command

pandoc -f gfm+fancy_lists -t html pandoc_test.md -o pandoc_test.html

The output HTML I get is

<h2 id="fancy-list-test">Fancy list test</h2>
<p>#. Item 1 #. Item 2 #. Item 3</p>

I would expect the output to be

<h2 id="fancy-list-test">Fancy list test</h2>
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>

Which is also what I get if I change the from format from gfm to markdown which has fancy_lists enabled by default.

Pandoc version?
Using pandoc v3.6.3 on macOS 15.3.1

@bkarpati bkarpati added the bug label Mar 6, 2025
@bkarpati
Copy link
Author

bkarpati commented Mar 6, 2025

A potential workaround is to just use 1. as every number in the list.

1. Item 1
1. Item 2
1. Item 3

Will produce

<ol type="1">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>

The downside is that some IDEs might complain about the list indices being incorrectly numbered.

@jgm
Copy link
Owner

jgm commented Mar 6, 2025

fancy_lists works. (Try e.g. (i).)
But note what the documentation says (and note that gfm is implemented as extension on commonmark):

The fancy_lists extension also allows ‘#’ to be used as an ordered list marker in place of a numeral:

#. one
#. two

Note: the ‘#’ ordered list marker doesn’t work with commonmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants