Class: Redcarpet::Form::Extension::Inline::Input

Inherits:
Object
  • Object
show all
Defined in:
lib/redcarpet/form/extension/inline/input.rb

Overview

A single input tag

Ex: [input]{ type=“number” } <input type=“number” name=“” />

Class Method Summary collapse

Class Method Details

.default_attributesObject



16
17
18
# File 'lib/redcarpet/form/extension/inline/input.rb', line 16

def self.default_attributes
  { 'type' => 'text', 'name' => Util.random_string }
end

.html(text) ⇒ Object



20
21
22
23
# File 'lib/redcarpet/form/extension/inline/input.rb', line 20

def self.html(text)
  attrs = default_attributes.merge!(Util.parse_attributes(text))
  "<input #{Util.attributes_to_s(attrs)} />"
end

.patternObject



12
13
14
# File 'lib/redcarpet/form/extension/inline/input.rb', line 12

def self.pattern
  /\[input\]([{][^}]*[}])?/
end