jagregory / atom-pandoc-preview

Pandoc-powered Previewer for Atom
MIT License
14 stars 7 forks source link

Previewing Failed #7

Closed dashed closed 10 years ago

dashed commented 10 years ago

I'm receiving the following error:

Previewing Failed

pandoc: unrecognized option `- ' unrecognized option `--S --self-contained' Try pandoc --help for more information.
jagregory commented 10 years ago

What version of pandoc are you using? Operating system?

Alternatively, this could be a flaw in the way I'm using child_process.

dashed commented 10 years ago

pandoc 1.12.3.1 and OSX (obviously :wink: ) 10.9.1.

I edited the following args function in pandoc-command.coffee:

args = (from) ->
  _.flatten(["-f #{language from} -t html5", atom.config.get('pandoc.args')])
  .join(' ').split(' ')

PR'd in #8

Whitespace in elements of args for child_process.spawn doesn't really play nicely.

dashed commented 10 years ago

Also forgot to mention that I'm using Atom v0.71.0.

dashed commented 10 years ago

I tried the following:

args = (from) ->
  #_.flatten(["-f #{language from} -t html5", atom.config.get('pandoc.args')])

  pandoc_args = "-f #{language from} -t html5" + ' ' + atom.config.get('pandoc.args')
  pandoc_args = pandoc_args.split(' -')
  _.each(pandoc_args, (elem, index, array)->
    array[index] = '-' + elem if index > 0
    )

  console.log(pandoc_args)
  return pandoc_args

But I get the following error:

Previewing Failed

pandoc: Unknown reader: markdown
dashed commented 10 years ago

As for the error pandoc: Unknown reader: markdown, pandoc was interpreting the following as an invalid ' markdown' reader, instead of 'markdown'. (there is a whitespace in the beginning via -f markdown).

I resolved this in latest PR update in #8.

nylki commented 10 years ago

I can confirm this problem on OS X 10.9.2 with atom 0.8.*