Class: Markbridge::Parsers::BBCode::Handlers::TableHandler
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- Markbridge::Parsers::BBCode::Handlers::TableHandler
- Defined in:
- lib/markbridge/parsers/bbcode/handlers/table_handler.rb
Overview
Handler for table tags
Instance Attribute Summary collapse
-
#element_class ⇒ Object
readonly
Returns the value of attribute element_class.
Instance Method Summary collapse
-
#initialize ⇒ TableHandler
constructor
A new instance of TableHandler.
- #on_close(token:, context:, registry:, tokens: nil) ⇒ Object
- #on_open(token:, context:, registry:, tokens: nil) ⇒ Object
Methods inherited from BaseHandler
Constructor Details
#initialize ⇒ TableHandler
Returns a new instance of TableHandler.
9 10 11 |
# File 'lib/markbridge/parsers/bbcode/handlers/table_handler.rb', line 9 def initialize @element_class = AST::Table end |
Instance Attribute Details
#element_class ⇒ Object (readonly)
Returns the value of attribute element_class.
27 28 29 |
# File 'lib/markbridge/parsers/bbcode/handlers/table_handler.rb', line 27 def element_class @element_class end |
Instance Method Details
#on_close(token:, context:, registry:, tokens: nil) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/markbridge/parsers/bbcode/handlers/table_handler.rb', line 18 def on_close(token:, context:, registry:, tokens: nil) # Auto-close open cell before closing row context.pop if context.current.is_a?(AST::TableCell) # Auto-close open row before closing table context.pop if context.current.is_a?(AST::TableRow) super end |