Class: Rabbit::Parser::RD::Ext::Refer
- Includes:
- Image
- Defined in:
- lib/rabbit/parser/rd/ext/refer.rb
Instance Method Summary collapse
- #default_ext_refer(label, source, content, visitor) ⇒ Object
-
#ext_refer_quote(label, source, content, visitor) ⇒ Object
def ext_refer_img(label, content, visitor) img(label, content, visitor) end.
Methods included from Image
Methods included from Ext::Image
make_image, make_image_from_file
Methods inherited from Base
add_extension, #apply, extensions, #extensions, inherited, method_added
Instance Method Details
#default_ext_refer(label, source, content, visitor) ⇒ Object
11 12 13 14 15 |
# File 'lib/rabbit/parser/rd/ext/refer.rb', line 11 def default_ext_refer(label, source, content, visitor) ref = ReferText.new(content) ref.to = label.element_label ref end |
#ext_refer_quote(label, source, content, visitor) ⇒ Object
def ext_refer_img(label, content, visitor)
img(label, content, visitor)
end
22 23 24 25 26 27 28 29 |
# File 'lib/rabbit/parser/rd/ext/refer.rb', line 22 def ext_refer_quote(label, source, content, visitor) return nil unless /^quote:(.*)$/ =~ label.element_label quoted_name = $1 quoted_label = ::RD::Reference::RDLabel.new(quoted_name, label.filename) source = quoted_label.to_s if label.to_s == source default_ext_refer(quoted_label, source, content) end |