Method: Mdoc::Pipeline#insert

Defined in:
lib/mdoc/pipeline.rb

#insert(prc, opts = {}) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/mdoc/pipeline.rb', line 17

def insert(prc, opts = {})
  prc = get_prc(prc)
  raise 'can not set before with after' if opts[:before] && opts[:after]
  ankor = opts[:before] || opts[:after]
  offset = get_offset(opts) if ankor
  ankor ? @processors.insert(offset, *prc) :
          @processors = prc.concat(@processors)
end