Class: Markbridge::AST::Code
- Defined in:
- lib/markbridge/ast/code.rb
Overview
Represents an inline or block code element.
Constant Summary
Constants inherited from Node
Instance Attribute Summary collapse
-
#block ⇒ Boolean?
readonly
trueforces a fenced block; anything else leaves the block-or-inline decision to the renderer. -
#language ⇒ String?
readonly
The programming language for syntax highlighting.
Attributes inherited from Element
Instance Method Summary collapse
-
#initialize(language: nil, block: nil) ⇒ Code
constructor
Create a new code element.
Methods inherited from Element
#<<, #descendants, #each_descendant, #replace_child, #replace_children
Methods inherited from Node
ast_chain, descendants, inherited
Constructor Details
#initialize(language: nil, block: nil) ⇒ Code
Create a new code element.
27 28 29 30 31 |
# File 'lib/markbridge/ast/code.rb', line 27 def initialize(language: nil, block: nil) super() @language = language @block = block end |
Instance Attribute Details
#block ⇒ Boolean? (readonly)
Returns true forces a fenced block; anything else
leaves the block-or-inline decision to the renderer.
20 21 22 |
# File 'lib/markbridge/ast/code.rb', line 20 def block @block end |
#language ⇒ String? (readonly)
Returns the programming language for syntax highlighting.
16 17 18 |
# File 'lib/markbridge/ast/code.rb', line 16 def language @language end |