Sha256: f3b63e6032f6af712630053877b7af834743c5ceb3ec7d63f4e67482b38e7a5b

Contents?: true

Size: 525 Bytes

Versions: 51

Compression:

Stored size: 525 Bytes

Contents

class Shortcode::Transformer < Parslet::Transform

  rule(text: simple(:text)) { String(text) }
  rule(
    open:     simple(:name),
    options:  subtree(:options),
    inner:    sequence(:inner),
    close:    simple(:name)
  ) { Shortcode::Tag.new(name.to_s, options, inner.join, additional_attributes).render }
  rule(
    open_close: simple(:name),
    options:    subtree(:options)
  ) { Shortcode::Tag.new(name.to_s, options, '', additional_attributes).render }

  rule(body: sequence(:strings)) { strings.join }

end

Version data entries

51 entries across 51 versions & 2 rubygems

Version Path
virgo-0.3.17 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.16 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.15 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.14 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.13 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.12 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.11 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.10 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.9 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.8 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.7 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.6 vendor/gems/shortcode/lib/shortcode/transformer.rb
shortcode-1.1.1 lib/shortcode/transformer.rb
virgo-0.3.4 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.3 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.2 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3.1 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.3 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.2.9 vendor/gems/shortcode/lib/shortcode/transformer.rb
virgo-0.2.8 vendor/gems/shortcode/lib/shortcode/transformer.rb