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