Class: DatoDast::Nodes::Span
- Inherits:
-
Base
- Object
- Base
- DatoDast::Nodes::Span
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
Instance Method Details
#marks ⇒ Object
4
5
6
|
# File 'lib/dato_dast/nodes/span.rb', line 4
def marks
@node["marks"] || []
end
|
#render_value ⇒ Object
16
17
18
|
# File 'lib/dato_dast/nodes/span.rb', line 16
def render_value
value
end
|
#value ⇒ Object
8
9
10
|
# File 'lib/dato_dast/nodes/span.rb', line 8
def value
@node["value"].gsub(/\n/, "<br/>")
end
|
#wrappers ⇒ Object
12
13
14
|
# File 'lib/dato_dast/nodes/span.rb', line 12
def wrappers
Array.wrap(super) + marks.map { |mark| config.marks[mark] }
end
|