Sha256: 85892b89184bb2ef57b6ec36b8179568e6754292e9803037d8e294b66f5ddc59
Contents?: true
Size: 618 Bytes
Versions: 28
Compression:
Stored size: 618 Bytes
Contents
# frozen_string_literal: true module Stepmod module Utils module Converters class Em < ReverseAdoc::Converters::Base def convert(node, state = {}) content = treat_children(node, state.merge(already_italic: true)) if content.strip.empty? || state[:already_italic] content else "#{content[/^\s*/]}_#{content.strip}_#{content[/\s*$/]}" end end end ReverseAdoc::Converters.register :em, Em.new ReverseAdoc::Converters.register :i, Em.new ReverseAdoc::Converters.register :cite, Em.new end end end
Version data entries
28 entries across 28 versions & 1 rubygems