tbfisher / sublimetext-Pandoc

A Sublime Text plugin that uses Pandoc to convert text from one markup format into another. Pandoc can convert documents in markdown, reStructuredText, textile, HTML, DocBook, LaTeX, MediaWiki markup, OPML, or Haddock markup to XHTML, HTML5, HTML slide shows using Slidy, reveal.js, Slideous, S5, or DZSlides, Microsoft Word docx, OpenOffice/LibreOffice ODT, OpenDocument XML, EPUB version 2 or 3, FictionBook2, DocBook, GNU TexInfo, Groff man pages, Haddock markup, OPML, LaTeX, ConTeXt, LaTeX Beamer slides, PDF via LaTeX, Markdown, reStructuredText, AsciiDoc, MediaWiki markup, Emacs Org-Mode, Textile, or custom writers can be written in lua.
MIT License
137 stars 26 forks source link

pandoc run via ST3 sublimetext-Pandoc failes to convert fancy lists correctly #73

Closed gstalnaker closed 4 years ago

gstalnaker commented 4 years ago

According to Pandoc docs, fancy lists are supported:

Extension: fancy_lists

Unlike standard Markdown, pandoc allows ordered list items to be marked with uppercase and lowercase letters and roman numerals, in addition to Arabic numerals. List markers may be enclosed in parentheses or followed by a single right-parentheses or period. They must be separated from the text that follows by at least one space, and, if the list marker is a capital letter with a period, by at least two spaces.

Using latest pandoc version pandoc-2.9.1.1-windows-x86_64.msi on Windows 10, ST3 v3.2.2 build 3211

My ST3 Pandoc is configured thus:

      "HTML 5": {
        "new-buffer": 1,
        "scope": {
          "text.html.markdown": "markdown+blank_before_blockquote+fenced_code_blocks+backtick_code_blocks+line_blocks+fancy_lists+startnum+definition_lists+example_lists+table_captions+simple_tables+multiline_tables+pipe_tables+raw_html"
        },
        "syntax_file": "Packages/HTML/HTML.tmLanguage",
        "pandoc-arguments": [
          "--to=html5",
          "--no-highlight",
          ==
          "--tab-stop=2"
        ]
      },

Trying to convert to HTML this markdown:

1.  Ordinal list item
    A.  Uppercase list item
        1)  Ordinal parenthesize list item
        1)  Ordinal parenthesize list item
1.  Ordinal list item
    A.  Uppercase list item
        1)  Ordinal parenthesize list item
    A.  Uppercase list item
        1)  Ordinal parenthesize list item

Produces this output:

<ol type="1">
<li>Ordinal list item A. Uppercase list item
<ol type="1">
<li>Ordinal parenthesize list item</li>
<li>Ordinal parenthesize list item</li>
</ol></li>
<li>Ordinal list item A. Uppercase list item
<ol type="1">
<li>Ordinal parenthesize list item A. Uppercase list item</li>
<li>Ordinal parenthesize list item</li>
</ol></li>
</ol>

It should produce this:

<ol type="1">
<li>Ordinal list item
<ol type="A">
<li>Uppercase list item
<ol type="1">
<li>Ordinal parenthesize list item</li>
<li>Ordinal parenthesize list item</li>
</ol></li>
</ol></li>
<li>Ordinal list item
<ol type="A">
<li>Uppercase list item
<ol type="1">
<li>Ordinal parenthesize list item</li>
</ol></li>
<li>Uppercase list item
<ol type="1">
<li>Ordinal parenthesize list item</li>
</ol></li>
</ol></li>
</ol>
MPvHarmelen commented 4 years ago

Parsing problems shouldn't be caused by this plugin, as the only thing it does is compile the correct command and run that. Sublime's console should show which command is run. Have you tried running that yourself?