Class: DatoDast::Nodes::Span

Inherits:
Base
  • Object
show all
Defined in:
lib/dato_dast/nodes/span.rb

Constant Summary

Constants inherited from Base

Base::EMPTY, Base::NEWLINE

Instance Method Summary collapse

Methods inherited from Base

#children, #config, #css_class, #initialize, #meta, #node_config, #render, #render_children, #tag, #tag_info, #type, type

Constructor Details

This class inherits a constructor from DatoDast::Nodes::Base

Instance Method Details

#marksObject



4
5
6
# File 'lib/dato_dast/nodes/span.rb', line 4

def marks
  @node["marks"] || []
end

#render_valueObject



16
17
18
# File 'lib/dato_dast/nodes/span.rb', line 16

def render_value
  value
end

#valueObject



8
9
10
# File 'lib/dato_dast/nodes/span.rb', line 8

def value
  @node["value"].gsub(/\n/, "<br/>")
end

#wrappersObject



12
13
14
# File 'lib/dato_dast/nodes/span.rb', line 12

def wrappers
  Array.wrap(super) + marks.map { |mark| config.marks[mark] }
end