Class: Markbridge::AST::Size

Inherits:
Element show all
Defined in:
lib/markbridge/ast/size.rb

Overview

Represents sized text. Note: Discourse doesn’t support inline size changes by default, but this preserves size information for migration/custom rendering.

Examples:

Sized text

size = AST::Size.new(size: "20")
size << AST::Text.new("Big text")

Instance Attribute Summary collapse

Attributes inherited from Element

#children

Instance Method Summary collapse

Methods inherited from Element

#<<

Constructor Details

#initialize(size: nil) ⇒ Size

Create a new Size element.

Parameters:

  • size (String, nil) (defaults to: nil)

    font size value



19
20
21
22
# File 'lib/markbridge/ast/size.rb', line 19

def initialize(size: nil)
  super()
  @size = size
end

Instance Attribute Details

#sizeString? (readonly)

Returns the font size value.

Returns:

  • (String, nil)

    the font size value



14
15
16
# File 'lib/markbridge/ast/size.rb', line 14

def size
  @size
end