Skip to content

Outvar and context errors when used in Middleman (Patch included) #38

Description

@joallard

Related to #23, I took another approach, instead to remove extra options. I patched it on the fly in config.rb:

class ::PandocRuby
  module OptionPatch
    OPT_REMOVE_LIST = [:outvar, :context]

    # opts passed in. Recursively calls itself in order to handle hash options.
    def prepare_options(opts = [])
      opts.inject('') do |string, (option, value)|
        string + if value
                   create_option(option, value)
                 elsif option.respond_to?(:each_pair)
                   option = filter_option_hash(option)
                   prepare_options(option)

                 else
                   create_option(option)
                 end
      end
    end

    def filter_option_hash(hash)
      hash.reject do |k,v|
        OPT_REMOVE_LIST.include?(k)
      end
    end
  end
end

PandocRuby.prepend PandocRuby::OptionPatch

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions