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

Extensions with underscores not parsing correctly #10

Open
inhaledesign opened this issue Jan 7, 2017 · 5 comments
Open

Extensions with underscores not parsing correctly #10

inhaledesign opened this issue Jan 7, 2017 · 5 comments

Comments

@inhaledesign
Copy link

I'm trying to use the 'markdown_in_html_blocks' extension. When I add it in _config,yml and try to build with Jekyll, I get the following error:

Conversion error: Jekyll::Converters::Markdown encountered an error while converting '_posts/2014-08-20-another-post.md':
pandoc: unrecognized option `--markdown-in-html-blocks' Try pandoc --help for more information.

Notice that the error shows the option as having hyphens instead of underscores. I tested this out with a few other extensions that have underscores and saw the same pattern. Random extensions that do not have underscores did not result in an error.

_config.yml:

# Markdown config
gems: [ jekyll-pandoc ]
markdown: Pandoc
pandoc:
  extensions:
    - markdown_in_html_blocks
@gwerbin
Copy link

gwerbin commented Jan 25, 2017

This is because that isn't the correct way to pass an extension to Pandoc. The actual invocation would be

pandoc --from markdown+markdown_in_html_blocks

rather than

pandoc --from markdown --markdown_in_html_blocks

So it seems all extensions would be handled incorrectly here.

@dawaltconley
Copy link

Similar issue: I'm trying to remove the implicit_figures extension. I'd imagine this should work:

pandoc:
  extensions:
    - "from=markdown-implicit_figures"

But I'm getting jekyll 3.4.3 | Error: pandoc: Unknown extension: implicit

My guess is that @radixdiaboli is right, and the underscores are being converted to hyphens, which is causing pandoc to try and subtract the extension called "implicit" as well as the extension called "figures".

@svlauer
Copy link

svlauer commented Jul 28, 2017

@dawaltconley : I was struggling with a similar problem. Not sure if works in all cases, but in your case, the problem can be solved by taking advantage of the fact that the underscore appears in the option VALUE, not in the option name. So that should be:

pandoc:
  extensions:
    - from: "markdown-implicit_figures"

With this, there will be no conversion of underscores in the value.

@stalegjelsten
Copy link

I think I have experienced the same bug. Pandoc extensions like smart are working, but I cannot get the table_captions extension to work.

Anyone have any suggestions for a (temporary at least) solution?

@mauromorales
Copy link

mauromorales commented Aug 6, 2018

It seems that's not the case anymore:

jekyll 3.8.3 | Error:  --smart/-S has been removed.  Use +smart or -smart extension instead.
For example: pandoc -f markdown+smart -t markdown-smart.
Try pandoc --help for more information.

But the issue seems to come from the underlying pandoc wrapper gem pandoc-ruby as you can see here:

content = PandocRuby.new(content, *extensions).send("to_#{format}")

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

No branches or pull requests

6 participants