Class: DatoDast::Nodes::Code
- Inherits:
-
Base
- Object
- Base
- DatoDast::Nodes::Code
show all
- Defined in:
- lib/dato_dast/nodes/code.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_children, #tag, #tag_info, #type, type, #wrappers
Instance Method Details
#code ⇒ Object
8
9
10
|
# File 'lib/dato_dast/nodes/code.rb', line 8
def code
@node["code"]
end
|
#language ⇒ Object
4
5
6
|
# File 'lib/dato_dast/nodes/code.rb', line 4
def language
@node["language"]
end
|
#render ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/dato_dast/nodes/code.rb', line 12
def render
if highlighter?
highlight
else
super
end
end
|
#render_value ⇒ Object
20
21
22
|
# File 'lib/dato_dast/nodes/code.rb', line 20
def render_value
code.gsub(/\n/, "<br/>")
end
|