Class: Stepmod::Utils::Converters::Strong

Inherits:
ReverseAdoc::Converters::Base
  • Object
show all
Defined in:
lib/stepmod/utils/converters/strong.rb

Constant Summary collapse

BLANK_CHARS =
"{blank}".freeze

Instance Method Summary collapse

Instance Method Details

#convert(node, state = {}) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/stepmod/utils/converters/strong.rb', line 9

def convert(node, state = {})
  content = treat_children(node, state.merge(already_strong: true))
  if content.strip.empty? || state[:already_strong]
    content
  else
    handle_express_escape_seq(node, "#{content[/^\s*/]}*#{content.strip}*#{content[/\s*$/]}")
  end
end